/* ==========================================================================
   보험 고객센터 — 고객 화면 + 관리자 화면
   모바일 기준으로 작성하고, 640 / 960 / 1024px에서 레이아웃을 넓혀 갑니다.
   ========================================================================== */

:root {
  --navy-950: #07254a;
  --navy-900: #0b3a6b;
  --navy-800: #12508f;
  --blue-700: #145fb0;
  --blue-600: #1f78d1;
  --sky-300: #9fcdee;
  --sky-200: #c4e1f7;
  --sky-100: #e8f4fd;

  --ground: #dcedfb;
  --surface: #ffffff;
  --ink: #10243b;
  --ink-2: #3b526b;
  --ink-3: #4d637b;
  --line: #bcd5ea;
  --line-2: #d3e4f2;

  --amber: #f4b13d;
  --amber-ink: #3d2600;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --ok: #17704a;
  --ok-bg: #e2f3ea;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(11, 58, 107, .07), 0 6px 18px rgba(11, 58, 107, .08);
  --shadow-2: 0 2px 4px rgba(11, 58, 107, .07), 0 16px 38px rgba(11, 58, 107, .14);

  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic",
          "Apple SD Gothic Neo", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--sky-300) transparent; }
body, h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }

body {
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  word-break: keep-all;
  overflow-wrap: anywhere;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
::selection { background: var(--sky-300); color: var(--navy-950); }
input, textarea, select { caret-color: var(--blue-600); }

:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; border-radius: 6px; }
.site-footer :focus-visible, .sidebar :focus-visible, .admin-top :focus-visible { outline-color: var(--amber); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: #fff; color: var(--navy-900); padding: 12px 18px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.icon { flex-shrink: 0; }
.wrap {
  width: 100%; max-width: 1120px; margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.br-wide { display: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); font-weight: 500; font-size: .9em; margin-left: 6px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: 2px solid transparent; border-radius: 14px;
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color .2s, border-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 60px; padding: 0 28px; font-size: 1.125rem; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .95rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-accent { background: var(--amber); color: var(--amber-ink); }
.btn-outline { background: transparent; color: var(--blue-700); border-color: var(--blue-700); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); min-height: 48px; font-size: .95rem; }
.btn:disabled, .btn.is-busy { opacity: .65; cursor: progress; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--navy-800); }
  .btn-light:hover { background: var(--sky-100); }
  .btn-accent:hover { background: #ffc255; }
  .btn-outline:hover { background: var(--sky-100); }
  .btn-danger:hover { background: var(--danger-bg); }
}

/* ---------- 상단 헤더 (고객 화면) ---------- */
.site-header { background: #fff; color: var(--navy-900); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px; background: rgba(255, 255, 255, .12); color: var(--amber);
}
.brand-logo { width: 40px; height: 40px; flex-shrink: 0; }
.login-logo { width: 72px; height: 72px; margin-bottom: 4px; }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: none; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px;
  border-radius: 12px; color: var(--ink-2); font-weight: 600; text-decoration: none; font-size: 1rem;
}
.call-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border-radius: 999px; background: var(--blue-700); color: #fff;
  font-weight: 800; font-size: 1rem; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums;
}
@media (hover: hover) { .nav-link:hover { background: var(--sky-100); color: var(--navy-900); } .call-pill:hover { background: var(--navy-800); } }

/* ---------- 알림 ---------- */
.flash-stack { display: grid; gap: 10px; padding-top: 20px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px;
  border-radius: 14px; font-weight: 600; font-size: 1.02rem; line-height: 1.5;
}
.flash svg { margin-top: 2px; }
.flash-error { background: var(--danger-bg); color: #8f1d14; border: 1px solid #f3c4be; }
.flash-ok { background: var(--ok-bg); color: #0f5a39; border: 1px solid #b7e0c9; }

/* ---------- 메인: 히어로 ---------- */
.hero { background: var(--sky-200); color: var(--navy-900); position: relative; overflow: hidden; padding: 28px 0 96px; }
.hero::after {
  content: ""; position: absolute; right: -140px; top: -180px; width: 520px; height: 520px;
  border-radius: 50%; background: var(--sky-100); opacity: .75; pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; gap: 28px; }
.hero h1 { font-size: clamp(2.05rem, 1.35rem + 3.2vw, 3.6rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.hero-lead { margin-top: 14px; color: var(--ink-2); font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); max-width: 36em; }
.contact-card {
  display: none; border: 1px solid var(--sky-300); background: #fff; box-shadow: var(--shadow-1);
  border-radius: 22px; padding: 22px; gap: 4px;
}
.contact-label { color: var(--ink-3); font-size: .95rem; font-weight: 600; }
.contact-name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; color: var(--navy-900); }
.contact-note { color: var(--ink-3); font-size: .95rem; margin-top: 8px; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .contact-card { animation: rise .7s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .contact-card { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

/* ---------- 메인: 접수 메뉴 ---------- */
.tasks-wrap { position: relative; z-index: 2; margin-top: -60px; }
.tasks { display: grid; gap: 14px; }

.task-featured {
  display: flex; flex-direction: column; gap: 20px; padding: 26px 24px 24px;
  background: var(--surface); border-radius: 26px; border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2); color: var(--ink); text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.task-featured-icon {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px;
  background: var(--amber); color: var(--amber-ink);
}
.task-featured-body { display: grid; gap: 8px; flex: 1; align-content: start; }
.task-featured-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.task-featured-desc { color: var(--ink-2); font-size: 1.08rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px;
  border-radius: 999px; background: var(--sky-100); color: var(--navy-800); font-size: .95rem; font-weight: 600;
}
.task-featured .btn { width: 100%; }

.task {
  display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.task-icon {
  display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 16px; background: var(--sky-100); color: var(--blue-700);
}
.task-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.task-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.task-desc { color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.task-go { color: var(--blue-600); flex-shrink: 0; }
@media (hover: hover) {
  .task-featured:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(11, 58, 107, .08), 0 24px 48px rgba(11, 58, 107, .16); }
  .task:hover { border-color: var(--blue-600); box-shadow: var(--shadow-1); transform: translateY(-2px); }
}

.check-strip {
  display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-top: 16px; padding: 20px;
  background: var(--sky-200); border: 1px solid var(--sky-300); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.check-strip-icon { display: none; }
.check-strip-body { display: grid; gap: 2px; flex: 1; }
.check-strip-title { font-size: 1.2rem; font-weight: 800; }
.check-strip-desc { color: var(--ink-2); font-size: 1rem; }
.check-strip .btn { width: 100%; background: #fff; }
@media (hover: hover) { .check-strip:hover .btn { background: var(--sky-100); } }

/* ---------- 메인: 이용 방법 ---------- */
.guide { display: grid; gap: 28px; margin-block: 56px 72px; }
.guide h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.steps { display: grid; gap: 18px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.step-no {
  display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: var(--blue-700); color: #fff; font-weight: 800; font-size: 1.05rem;
}
.steps strong { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.4; padding-top: 6px; }
.steps p { color: var(--ink-2); font-size: 1rem; margin-top: 2px; }
.privacy-note {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.privacy-icon { display: grid; place-items: center; width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: var(--sky-100); color: var(--blue-700); }
.privacy-note strong { font-size: 1.15rem; display: block; margin-bottom: 4px; }
.privacy-note p { color: var(--ink-2); font-size: 1rem; }

/* ---------- 폼 / 조회 페이지 공통 ---------- */
.page { padding-block: 20px 72px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 8px;
  color: var(--blue-700); font-weight: 700; text-decoration: none;
}
.split { display: grid; gap: 24px; }
.split-aside { display: grid; gap: 14px; align-content: start; }
.aside-icon {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px;
  background: var(--blue-700); color: #fff;
}
.aside-icon-sm { width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0; }
.split-aside h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem); font-weight: 800; letter-spacing: -.025em; }
.lead { color: var(--ink-2); font-size: 1.1rem; }
.tips { background: var(--sky-100); border: 1px solid var(--sky-200); border-radius: var(--radius); padding: 18px 20px; }
.tips h2 { font-size: 1.02rem; font-weight: 800; margin-bottom: 10px; color: var(--navy-900); }
.tips ul { display: grid; gap: 8px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 1.02rem; line-height: 1.5; }
.tips li svg { color: var(--blue-600); margin-top: 2px; }
.aside-call {
  display: none; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-2); text-decoration: none; font-size: 1rem; line-height: 1.4;
}
.aside-call svg { color: var(--blue-700); }
.aside-call strong { display: block; font-size: 1.3rem; color: var(--blue-700); font-variant-numeric: tabular-nums; }

.form-card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 26px;
  box-shadow: var(--shadow-1); padding: clamp(20px, 4vw, 36px); display: grid; gap: 24px; align-content: start;
}
.split-main { display: grid; gap: 28px; align-content: start; min-width: 0; }

.field-grid { display: grid; gap: 22px; }
.field { min-width: 0; }
.field > label, .field > .label, .label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 1.06rem;
}
.req, .opt { font-size: .78rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; line-height: 1.6; }
.req { color: var(--danger); background: var(--danger-bg); }
.opt { color: var(--ink-3); background: var(--ground); }
.hint { margin: -2px 0 10px; font-size: .95rem; color: var(--ink-2); line-height: 1.5; }

input[type="text"], input[type="tel"], input[type="password"], input[type="email"], textarea, select {
  display: block; width: 100%; min-height: 58px; padding: 12px 16px;
  border: 2px solid #7a99b8; border-radius: 14px; background: #fff; color: var(--ink);
  font: inherit; font-size: 1.125rem; line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 168px; resize: vertical; }
select {
  appearance: none; padding-right: 48px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23145fb0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
::placeholder { color: #5f7389; opacity: 1; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(31, 120, 209, .2); }
@media (hover: hover) { input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) { border-color: var(--blue-600); } }

.dropzone { position: relative; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.dropzone label {
  display: grid; justify-items: center; gap: 4px; text-align: center; padding: 28px 16px;
  border: 2px dashed var(--blue-600); border-radius: 18px; background: var(--sky-100); color: var(--blue-700);
  transition: background-color .2s;
}
.dropzone:focus-within label { outline: 3px solid var(--blue-600); outline-offset: 3px; }
.dz-title { font-size: 1.15rem; font-weight: 800; color: var(--navy-900); margin-top: 4px; }
.dz-sub { font-size: .95rem; color: var(--ink-2); }
@media (hover: hover) { .dropzone:hover label { background: var(--sky-200); } }
.file-names { display: grid; gap: 8px; margin-top: 10px; }
.file-names:empty { display: none; }
.file-names li { padding: 10px 14px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; font-size: .98rem; word-break: break-all; }
.file-names .file-more { color: var(--danger); background: var(--danger-bg); border-color: #f3c4be; font-weight: 600; }

.agree { padding: 18px; background: var(--sky-100); border: 1px solid var(--sky-200); border-radius: 16px; }
.agree-label { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.agree-label input { width: 28px; height: 28px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--blue-700); cursor: pointer; }
.agree-label strong { display: block; font-size: 1.06rem; }
.agree-label small { display: block; margin-top: 4px; font-size: .92rem; color: var(--ink-2); line-height: 1.55; }
.agree-warn { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--danger); font-weight: 700; font-size: .98rem; }

/* ---------- 접수 완료 ---------- */
.success-card {
  max-width: 640px; margin: clamp(16px, 5vw, 56px) auto 0; padding: clamp(28px, 6vw, 56px) clamp(20px, 5vw, 48px);
  background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-2); text-align: center;
  display: grid; gap: 14px; justify-items: center;
}
.success-mark { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); margin-bottom: 6px; }
.success-card h1 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.success-lead { color: var(--ink-2); }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 14px; width: 100%; }
.success-actions .btn { flex: 1 1 220px; }
.success-call { margin-top: 10px; color: var(--ink-2); font-size: 1rem; }
.success-call a { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none; font-variant-numeric: tabular-nums; }

/* ---------- 조회 결과 ---------- */
.result-count { font-size: 1.25rem; font-weight: 800; }
.result-count strong { color: var(--blue-700); }
.result-list { display: grid; gap: 16px; }
.result { background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow-1); padding: 22px; display: grid; gap: 18px; }
.result-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.result-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--sky-100); color: var(--blue-700); }
.result-head h3 { font-size: 1.25rem; font-weight: 800; }
.result-date { color: var(--ink-3); font-size: .95rem; font-variant-numeric: tabular-nums; }
.result-message { background: var(--ground); border-radius: 14px; padding: 14px 16px; white-space: pre-wrap; color: var(--ink-2); font-size: 1.02rem; }

.track { display: flex; }
.track li { flex: 1; position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.track li + li::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 3px; background: var(--line); }
.track-dot { position: relative; z-index: 1; width: 25px; height: 25px; border-radius: 50%; background: #fff; border: 3px solid var(--line); }
.track-label { font-size: .98rem; color: var(--ink-3); font-weight: 600; }
.track .is-done::before, .track .is-current::before { background: var(--blue-700); }
.track .is-done .track-dot { background: var(--blue-700); border-color: var(--blue-700); }
.track .is-current .track-dot { border-color: var(--blue-700); box-shadow: 0 0 0 5px rgba(20, 95, 176, .18); background: #fff; }
.track .is-current .track-label, .track .is-done .track-label { color: var(--navy-900); font-weight: 800; }

.reply { background: var(--sky-100); border: 1px solid var(--sky-200); border-radius: 16px; padding: 16px 18px; }
.reply-label { display: flex; align-items: center; gap: 8px; color: var(--navy-800); font-weight: 800; margin-bottom: 6px; }
.reply-text { white-space: pre-wrap; }
.reply-waiting { color: var(--ink-3); font-size: 1rem; }

.empty {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 48px 20px;
  background: var(--surface); border: 2px dashed var(--line); border-radius: 22px; color: var(--ink-2);
}
.empty-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--sky-100); color: var(--blue-700); margin-bottom: 6px; }
.empty-title { font-size: 1.2rem; font-weight: 800; color: var(--ink); }

/* ---------- 배지 ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 14px; border-radius: 999px; font-size: .92rem; font-weight: 800; white-space: nowrap; }
.badge-lg { padding: 8px 20px; font-size: 1.05rem; }
.badge-접수 { background: #fdeccb; color: #6b3f00; }
.badge-처리중 { background: var(--sky-200); color: var(--navy-900); }
.badge-완료 { background: var(--ok-bg); color: #0f5a39; }

/* ---------- 푸터 ---------- */
.site-footer { background: var(--navy-950); color: var(--sky-300); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); }
.footer-inner { display: grid; gap: 14px; }
.footer-name { color: #fff; font-weight: 800; font-size: 1.1rem; }
.footer-contact { font-size: 1rem; }
.site-footer a { color: #fff; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.footer-small { font-size: .92rem; color: #8fb4d6; }

/* ---------- 관리자 로그인 ---------- */
.page-login { background: var(--sky-200); }
.login-stage { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 36px 28px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); display: grid; gap: 10px; justify-items: center; text-align: center;
}
.login-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.login-sub { color: var(--ink-3); margin-bottom: 14px; }
.login-card form { display: grid; gap: 18px; width: 100%; text-align: left; }
.login-back { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; margin-top: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; font-size: 1rem; }

/* ==========================================================================
   관리자 화면
   ========================================================================== */
body.admin { font-size: 1rem; line-height: 1.6; }
.admin-shell { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; }
.sidebar { display: none; }
.admin-main { min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.admin-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy-900); color: #fff; min-height: 60px;
  padding: 8px max(var(--gutter), env(safe-area-inset-right)) 8px max(var(--gutter), env(safe-area-inset-left));
}
.brand-name small { display: block; font-size: .78rem; font-weight: 600; color: var(--sky-300); letter-spacing: 0; line-height: 1.2; }
.top-logout, .side-logout {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  color: var(--sky-200); font-weight: 600; text-decoration: none; font-size: .95rem;
}
.admin-content { width: 100%; max-width: 1240px; margin-inline: auto; padding: clamp(18px, 3vw, 40px) max(var(--gutter), env(safe-area-inset-right)) 40px max(var(--gutter), env(safe-area-inset-left)); }
.admin-content .flash-stack { padding-top: 0; margin-bottom: 18px; }
.admin-content .back-link { margin-left: -2px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 20px rgba(11, 58, 107, .08);
}
.tabbar a {
  display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 66px;
  color: var(--ink-2); text-decoration: none; font-size: .82rem; font-weight: 700;
}
.tabbar a.is-active { color: var(--blue-700); box-shadow: inset 0 3px 0 var(--blue-700); }
.tab-icon { position: relative; display: block; }
.tab-icon .count-badge { position: absolute; top: -6px; left: 16px; }
.count-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--amber); color: var(--amber-ink); font-style: normal; font-size: .78rem; font-weight: 800; line-height: 1;
}

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.55rem, 1.25rem + 1vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--ink-2); font-size: 1rem; }
.detail-title { display: flex; align-items: center; gap: 14px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.seg { display: flex; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 16px; max-width: 100%; overflow-x: auto; }
.seg a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  color: var(--ink-2); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.seg em { font-style: normal; font-size: .85rem; padding: 1px 9px; border-radius: 999px; background: var(--ground); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.seg a.is-on { background: var(--blue-700); color: #fff; }
.seg a.is-on em { background: rgba(255, 255, 255, .22); color: #fff; }
@media (hover: hover) { .seg a:not(.is-on):hover { background: var(--sky-100); } }
.type-filter select { min-height: 52px; font-size: 1rem; width: auto; min-width: 180px; }

.table-card { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { display: none; }
.data-table tbody, .data-table tr, .data-table td { display: block; }
.data-table tr {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px;
  grid-template-areas: "name status" "type type" "phone date";
  padding: 16px 18px; border-top: 1px solid var(--line-2); cursor: pointer;
}
.data-table tr:first-child { border-top: 0; }
.col-no, .col-go { display: none !important; }
.col-name { grid-area: name; }
.col-status { grid-area: status; }
.col-type { grid-area: type; }
.data-table td:nth-child(4) { grid-area: phone; color: var(--ink-2); }
.data-table td:nth-child(5) { grid-area: date; justify-self: end; color: var(--ink-3); font-size: .92rem; }
.col-name a { color: var(--ink); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.is-new .col-name a { font-weight: 800; }
.is-new .col-name a::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px #fdeccb; vertical-align: middle; }
.type-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .95rem; }
.type-tag svg { color: var(--blue-600); }
@media (hover: hover) { .data-table tbody tr:hover { background: var(--sky-100); } }

/* 상세 */
.detail-grid { display: grid; gap: 18px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 18px; min-width: 0; }
.panel { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: clamp(18px, 3vw, 26px); }
.panel h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 16px; }
.info-row { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.info-row:first-child { border-top: 0; padding-top: 0; }
.info-row dt { color: var(--ink-3); font-weight: 600; font-size: .92rem; }
.info-row dd { white-space: pre-wrap; font-size: 1.05rem; }
.attach { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.attach li { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; align-content: start; }
.attach-thumb, .attach-doc { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--ground); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-doc { display: grid; place-items: center; align-content: center; gap: 2px; background: var(--sky-100); color: var(--blue-700); }
.attach-doc b { font-size: .85rem; }
.attach-name { font-size: .92rem; color: var(--ink-2); word-break: break-all; }

.handle { display: grid; gap: 18px; }
.handle h2 { margin-bottom: 0; }
.status-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 0; min-width: 0; }
.status-pick legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 1.06rem; }
.status-pick label { position: relative; display: block; }
.status-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.status-pick span {
  display: grid; place-items: center; min-height: 54px; border: 2px solid var(--line); border-radius: 12px;
  font-weight: 800; color: var(--ink-2); background: #fff; transition: background-color .2s, border-color .2s, color .2s;
}
.status-pick input:checked + span { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.status-pick input:focus-visible + span { outline: 3px solid var(--blue-600); outline-offset: 3px; }
.danger-zone { text-align: right; }

.settings-grid { display: grid; gap: 18px; align-items: start; }
.settings-grid .panel { display: grid; gap: 20px; align-content: start; }
.settings-grid .panel h2 { margin-bottom: 0; }
.form-actions { margin-top: 18px; max-width: 360px; }

/* ==========================================================================
   태블릿 (640px~)
   ========================================================================== */
@media (min-width: 640px) {
  .header-inner { min-height: 72px; }
  .brand-name { font-size: 1.2rem; }
  .nav-link { display: inline-flex; }
  .call-pill { padding: 0 20px; font-size: 1.05rem; }

  .hero { padding: 48px 0 132px; }
  .contact-card { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 20px; padding: 22px 26px; }
  .contact-card .contact-label, .contact-card .contact-name { grid-column: 1; margin: 0; }
  .contact-card .btn { grid-column: 2; grid-row: 1 / span 2; width: auto; }
  .contact-note { grid-column: 1 / -1; }

  .tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .task-featured { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 24px; padding: 28px 32px; }
  .task-featured .btn { width: auto; flex-shrink: 0; }
  .task { min-height: 104px; padding: 20px 22px; }

  .check-strip { flex-direction: row; align-items: center; gap: 18px; padding: 20px 26px; }
  .check-strip-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: #fff; color: var(--blue-700); flex-shrink: 0; }
  .check-strip .btn { width: auto; flex-shrink: 0; }

  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
  .field-full { grid-column: 1 / -1; }

  .login-card { padding: 44px 40px 32px; }

  .info-row { grid-template-columns: 150px 1fr; gap: 16px; }
  .info-row.info-wide { grid-template-columns: 1fr; gap: 2px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr auto; align-items: end; }
}

/* 표 형태 전환 (760px~) */
@media (min-width: 760px) {
  .data-table thead { display: table-header-group; }
  .data-table tbody { display: table-row-group; }
  .data-table tr { display: table-row; }
  .data-table td, .data-table th { display: table-cell; }
  .data-table th { text-align: left; padding: 14px 18px; background: var(--ground); color: var(--ink-3); font-size: .88rem; font-weight: 700; white-space: nowrap; }
  .table-card { overflow-x: auto; }
  .data-table td { padding: 16px 12px; vertical-align: middle; border-top: 1px solid var(--line-2); justify-self: auto; white-space: nowrap; }
  .data-table th { padding-inline: 12px !important; }
  .col-no { display: none !important; }
  .data-table tbody tr:first-child td { border-top: 0; }
  .data-table td:nth-child(4), .data-table td:nth-child(5) { font-size: 1rem; justify-self: auto; }
  .col-go { display: table-cell !important; }
  .col-no { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .col-go { width: 36px; color: var(--ink-3); text-align: right; }
  .col-go svg { display: inline-block; }
  .data-table tr { padding: 0; }
}

/* ==========================================================================
   작은 데스크톱 / 큰 태블릿 (960px~)
   ========================================================================== */
@media (min-width: 900px) {
  .br-wide { display: inline; }
  .hero-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: end; gap: 48px; }
  .contact-card { grid-template-columns: 1fr; padding: 26px; }
  .contact-card .contact-label, .contact-card .contact-name { grid-column: auto; }
  .contact-card .btn { grid-column: auto; grid-row: auto; width: 100%; }
  .contact-name { margin-bottom: 10px !important; }

  .guide { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 56px; align-items: start; }
}

@media (min-width: 960px) {
  .page { padding-block: 28px 96px; }
  .split { grid-template-columns: 340px minmax(0, 1fr); gap: 48px; align-items: start; }
  .split-aside { position: sticky; top: 100px; gap: 18px; }
  .aside-icon { width: 68px; height: 68px; border-radius: 22px; }
  .aside-call { display: flex; }
}

/* ==========================================================================
   데스크톱 (1024px~)
   ========================================================================== */
@media (min-width: 1024px) {
  .hero { padding: 64px 0 150px; }
  .tasks-wrap { margin-top: -96px; }
  .tasks { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .task-featured { grid-column: 1; grid-row: 1 / span 4; flex-direction: column; align-items: stretch; gap: 22px; padding: 36px; }
  .task-featured-icon { width: 84px; height: 84px; border-radius: 26px; }
  .task-featured-title { font-size: 2.3rem; }
  .task-featured-desc { font-size: 1.15rem; }
  .task-featured .btn { width: 100%; }
  .task { grid-column: 2; }

  .admin-shell { grid-template-columns: 264px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100dvh;
    padding: 24px 16px; background: var(--navy-900); color: #fff;
  }
  .sidebar .brand { padding: 0 8px; }
  .side-nav { display: grid; gap: 4px; }
  .side-nav a {
    display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border-radius: 12px;
    color: var(--sky-200); font-weight: 700; text-decoration: none; transition: background-color .2s;
  }
  .side-nav a .count-badge { margin-left: auto; }
  .side-nav a.is-active { background: rgba(255, 255, 255, .15); color: #fff; }
  .side-logout { margin-top: auto; }
  @media (hover: hover) { .side-nav a:not(.is-active):hover, .side-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; } }
  .admin-top, .tabbar { display: none; }
  .admin-main { padding-bottom: 0; }

  .detail-grid { grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; }
  .detail-side { position: sticky; top: 24px; }
  .col-no { display: table-cell !important; }
  .data-table td { padding: 16px 18px; }
  .data-table th { padding-inline: 18px !important; }
}

@media (min-width: 1280px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 440px; }
}

@media (max-width: 480px) {
  .seg a { padding: 0 10px; gap: 6px; }
}

/* 아주 좁은 화면 (아이폰 SE 등) */
@media (max-width: 380px) {
  .brand-name { font-size: 1rem; }
  .brand-logo { width: 36px; height: 36px; }
  .call-pill { padding: 0 12px; font-size: .95rem; gap: 6px; }
  .hero h1 { font-size: 1.95rem; }
  .task-featured-title { font-size: 1.6rem; }
  .status-pick { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Netlify 버전에서 추가된 부분
   ========================================================================== */
[hidden] { display: none !important; }

/* 로그인 확인이 끝나기 전에는 관리자 화면 내용을 숨김 */
body.is-loading .admin-shell, body.is-loading .tabbar { visibility: hidden; }

/* 로그아웃은 버튼으로 바뀌었으므로 버튼 기본 모양 제거 */
button.top-logout, button.side-logout {
  background: none; border: 0; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-align: left;
}

.login-flash { width: 100%; padding-top: 0; text-align: left; }
.login-flash .flash { margin: 0; }

/* 시연 모드 안내 줄 */
.demo-banner {
  background: #fff4d6; color: #5c3b00; border-bottom: 1px solid #f0d58a; padding: 10px var(--gutter);
  text-align: center; font-size: .95rem; font-weight: 600; line-height: 1.5;
}
