/* A/S 접수 관리 – 휴대폰에서 보기 좋게 */
:root {
  --navy: #0b2347;
  --blue: #1d5bd8;
  --blue-l: #e8effc;
  --ink: #16202f;
  --ink-2: #424d5e;
  --ink-3: #7a8394;
  --line: #dfe4ec;
  --gray: #f4f6f9;
  --white: #fff;
  --new: #d9480f;
  --new-l: #fff1ea;
  --done: #2b8a3e;
  --done-l: #ebf8ee;
  --r: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gray); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.55; letter-spacing: -0.015em; word-break: keep-all;
}
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.login__box {
  width: 100%; max-width: 360px; padding: 32px 24px; border-radius: 14px;
  background: var(--white); text-align: center;
}
.login__mark {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 10px; background: var(--navy); color: var(--white); font-weight: 900; font-size: 18px;
}
.login h1 { margin: 0; font-size: 22px; color: var(--navy); }
.login p { margin: 6px 0 20px; font-size: 15px; color: var(--ink-3); }
.login input {
  width: 100%; height: 54px; padding: 0 16px; border: 1.5px solid #cfd6e1; border-radius: var(--r);
  font: inherit; font-size: 22px; letter-spacing: .3em; text-align: center;
}
.login input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 91, 216, .15); }
.login button {
  width: 100%; height: 54px; margin-top: 10px; border: 0; border-radius: var(--r);
  background: var(--blue); color: var(--white); font-size: 17px; font-weight: 800;
}
.login button:disabled { opacity: .6; }
.login__home { display: inline-block; margin-top: 4px; font-size: 14px; color: var(--ink-3); text-decoration: none; }
.login__home:hover { color: var(--blue); }
.login__err { min-height: 1.4em; margin: 12px 0 0 !important; color: #d93a3f !important; font-weight: 600; }

/* ---------- 상단 바 ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--navy); color: var(--white);
}
.bar__title { display: flex; align-items: center; gap: 8px; }
.bar__title strong { font-size: 18px; }
.bar__badge {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  background: var(--new); font-size: 13px; font-weight: 800; line-height: 24px; text-align: center;
}
.bar__actions { display: flex; gap: 8px; }
.bar__actions button {
  height: 38px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .3); border-radius: var(--r);
  background: transparent; color: var(--white); font-size: 14px; font-weight: 700;
  display: grid; place-items: center;
}
.bar__actions svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#refreshBtn.is-spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.demo { margin: 0; padding: 10px 16px; background: #fff8db; color: #6b5300; font-size: 13.5px; }

.tools { padding: 14px 16px 0; max-width: 820px; margin: 0 auto; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 19px;
  background: var(--white); color: var(--ink-2); font-size: 14.5px; font-weight: 700;
}
.filter span { margin-left: 2px; color: var(--blue); }
.filter.is-on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.filter.is-on span { color: #9cc0ff; }
.notify-btn {
  margin-top: 10px; width: 100%; height: 42px; border: 1px dashed var(--blue); border-radius: var(--r);
  background: var(--blue-l); color: var(--blue); font-size: 14px; font-weight: 700;
}
.updated { max-width: 820px; margin: 10px auto 0; padding: 0 16px; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 접수 카드 ---------- */
.list { display: grid; gap: 12px; max-width: 820px; margin: 0 auto; padding: 10px 16px 40px; }
.card { background: var(--white); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.card.is-new { border-color: #f3b896; box-shadow: 0 0 0 2px var(--new-l); }
.card__head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3);
}
.status {
  padding: 2px 9px; border-radius: 4px; font-size: 12.5px; font-weight: 800;
  background: var(--new-l); color: var(--new);
}
.status[data-s="확인함"] { background: var(--blue-l); color: var(--blue); }
.status[data-s="완료"] { background: var(--done-l); color: var(--done); }
.card__time { margin-left: auto; }
.card__body { padding: 14px 16px; display: grid; gap: 10px; }
.card__who { font-size: 17px; font-weight: 800; color: var(--navy); }
.card__who small { margin-left: 6px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.contact { display: flex; flex-wrap: wrap; gap: 8px; }
.contact a {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px;
  border-radius: var(--r); text-decoration: none; font-weight: 800; font-size: 15px;
}
.contact .call { background: var(--blue); color: var(--white); }
.contact .sms, .contact .map { background: var(--gray); color: var(--navy); border: 1px solid var(--line); }
.contact svg { width: 18px; height: 18px; fill: currentColor; }
.row { font-size: 15px; color: var(--ink-2); }
.row b { display: inline-block; min-width: 44px; color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 3px 10px; border-radius: 4px; background: var(--gray); font-size: 13.5px; font-weight: 700; color: var(--navy); }
.memo { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--gray); font-size: 15px; white-space: pre-wrap; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos button { padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--gray); aspect-ratio: 1 / 1; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.nophoto { font-size: 13.5px; color: var(--ink-3); }
.card__foot { display: flex; gap: 8px; padding: 0 16px 14px; }
.card__foot button {
  flex: 1; height: 42px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--white); color: var(--ink-2); font-size: 14.5px; font-weight: 700;
}
.card__foot button.is-on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.card__foot button:disabled { opacity: .5; }

.empty { text-align: center; color: var(--ink-3); padding: 40px 16px; }

/* ---------- 사진 크게 보기 ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: 16px; background: rgba(0, 0, 0, .92);
}
.viewer img { max-width: 100%; max-height: 100%; border-radius: 4px; }
.viewer__close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px;
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: var(--white); font-size: 30px; line-height: 1;
}

@media (min-width: 700px) {
  .photos { grid-template-columns: repeat(5, 1fr); }
}
