/* 직원 화면(폰) 전용. 관리자·개인정보 화면은 style.css 를 그대로 쓴다.
   상징 = «오늘의 길»: 남색 판 위 세로 도로(노란 중앙선)에 오늘 다닌 곳을 정류장처럼 찍는다. */
:root {
  --ink: #0e2240;        /* 남색 판(상단 바·오늘 카드) */
  --ink-2: #183559;
  --steel: #2457a6;      /* 주요 버튼·고른 날 */
  --steel-press: #1b4486;
  --signal: #ffc531;     /* 도로 중앙선·핵심 버튼 */
  --signal-press: #f0b310;
  --go: #12925a;         /* 기록함 */
  --paper: #edf1f6;
  --card: #ffffff;
  --text: #13203a;
  --muted: #5f6e85;
  --line: #dce3ec;
  --danger: #c2362b;
  --p-commute: #2457a6; --p-client: #d99a00; --p-return: #12925a; --p-work: #0e8fa3; --p-personal: #8a97ab;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", system-ui, sans-serif;
  --num: "Barlow Condensed", "Pretendard Variable", sans-serif;
  --r: 18px;
  --shadow: 0 1px 2px rgba(14, 34, 64, .06), 0 8px 24px -12px rgba(14, 34, 64, .18);
  --tabs-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #0f2747; --ink-2: #1a3a63;
    --steel: #4a82d6; --steel-press: #3a6fc0;
    --paper: #0a1322; --card: #121d31; --text: #e6ecf5; --muted: #93a1b8; --line: #23324c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.app {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.err { color: var(--danger); font-size: 15px; margin: 6px 0; min-height: 0; }
.err:empty { display: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── 버튼·입력 ─────────────────────────────── */
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.primary {
  display: block; width: 100%; min-height: 58px; border: none; border-radius: 16px;
  background: var(--steel); color: #fff; font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
  box-shadow: 0 6px 16px -8px rgba(36, 87, 166, .7);
  transition: transform .12s ease, background-color .15s ease;
}
.primary:active:not(:disabled) { transform: scale(.98); background: var(--steel-press); }
.primary:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.primary.signal { background: var(--signal); color: #1c1600; box-shadow: 0 8px 20px -10px rgba(255, 197, 49, .9); }
.primary.signal:active { background: var(--signal-press); }
.ghost {
  display: block; width: 100%; min-height: 50px; margin-top: 10px; border-radius: 14px;
  border: 1.5px dashed var(--line); background: transparent; color: var(--steel); font-weight: 600;
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: none; background: transparent; color: inherit;
}
.icon-btn:active { background: rgba(127, 140, 160, .15); }
input, select {
  font: inherit; width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--steel); box-shadow: 0 0 0 4px rgba(36, 87, 166, .15); }
input::placeholder { color: var(--muted); opacity: .6; }
select {
  appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6e85' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 20px;
}
input[type=file] { padding: 10px; font-size: 15px; }
.num, .pin { font-family: var(--num); font-size: 24px; font-weight: 600; letter-spacing: .04em; }
.pin { letter-spacing: .5em; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

/* ── 번호판(대한민국 흰색 번호판 모양) ───────── */
.plate {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  background: #fff; color: #111; border: 2px solid #111; border-radius: 7px;
  font-weight: 800; font-size: 16px; letter-spacing: .02em; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px #fff, 0 2px 0 rgba(0, 0, 0, .25);
}
.plate.none { background: transparent; color: #c9d4e4; border: 2px dashed #4c6488; box-shadow: none; font-weight: 600; font-size: 14px; }

/* ── 상단 바 ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: var(--ink); color: #fff;
}
.car { display: flex; align-items: center; gap: 10px; min-width: 0; }
.model { color: #aebfd6; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-link { color: #aebfd6; font-size: 13px; text-decoration: none; padding: 6px 10px; border: 1px solid #2c4870; border-radius: 999px; white-space: nowrap; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); }
.hint { color: var(--muted); font-size: 14px; margin: 12px 4px; }
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }

/* ── 계기판 사진 알림 ──────────────────────── */
.notice-odometer {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  background: #fff6dc; color: #5c4200; border-radius: 16px; padding: 12px 12px 12px 14px; margin-bottom: 14px;
  border: 1px solid #f7d77a;
}
.notice-odometer .ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--signal); color: #1c1600; }
.notice-odometer b { display: block; font-size: 15px; }
.notice-odometer small { display: block; font-size: 13px; color: #82610f; }
.notice-odometer button { min-height: 44px; padding: 0 14px; border-radius: 12px; border: none; background: #1c1600; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .notice-odometer { background: #2a2210; color: #f6dfa0; border-color: #5a4614; }
  .notice-odometer small { color: #c9ac62; }
  .notice-odometer button { background: var(--signal); color: #1c1600; }
  .hero { box-shadow: inset 0 0 0 1px #24406a, 0 18px 40px -22px rgba(0, 0, 0, .8); }
}

/* ── 오늘 카드 = 남색 판 + 세로 도로 ───────── */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 20px 18px 18px;
  background: radial-gradient(120% 80% at 100% 0%, var(--ink-2) 0%, var(--ink) 60%);
  box-shadow: 0 18px 40px -22px rgba(14, 34, 64, .85);
}
.hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.hero-date b { display: block; font-family: var(--num); font-weight: 700; font-size: 54px; line-height: .9; letter-spacing: .01em; }
.hero-date span { display: block; margin-top: 6px; color: #aebfd6; font-size: 15px; font-weight: 600; }
.hero-km { text-align: right; font-size: 13px; color: #aebfd6; font-weight: 600; }
.hero-km b { display: block; font-family: var(--num); font-size: 40px; line-height: 1; color: var(--signal); font-weight: 700; }
.hero-km b small { font-size: 20px; margin-left: 2px; }
.hero-km .stamp { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(18, 146, 90, .25); color: #7fe0b0; font-size: 12px; }

/* 도로: 왼쪽 회색 아스팔트 띠 + 노란 점선 중앙선, 정류장은 흰 원 */
.road { position: relative; list-style: none; margin: 0 0 18px; padding: 0 0 0 44px; }
.road::before {
  content: ''; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 16px; border-radius: 8px;
  background: #2b4468;
}
.road::after {
  content: ''; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--signal) 0 7px, transparent 7px 13px);
}
.road li { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-height: 38px; padding: 6px 0; }
.road li::before {
  content: ''; position: absolute; left: -40px; top: 11px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ink); box-shadow: 0 0 0 2px #fff; z-index: 1;
}
.road li.end::before { background: var(--signal); }
.road .stop { font-weight: 700; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.road .leg { flex: none; font-size: 13px; color: #aebfd6; }
.road .leg b { font-family: var(--num); font-size: 18px; color: #fff; font-weight: 600; margin-right: 2px; }
.road.empty li .stop { color: #7f93b2; font-weight: 600; }
.road.empty li::before { background: transparent; border-color: #7f93b2; box-shadow: none; }

/* ── 달력 ─────────────────────────────────── */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { text-align: center; }
.cal-title b { display: block; font-family: var(--num); font-size: 28px; line-height: 1; font-weight: 700; letter-spacing: .02em; }
.cal-title span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.cal-title span em { font-style: normal; color: var(--danger); font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal .wd.sun { color: #d0473b; }
.cal button {
  position: relative; aspect-ratio: 1 / 1; min-height: 42px; padding: 0; border-radius: 12px;
  border: none; background: var(--paper); color: var(--text);
  font-family: var(--num); font-size: 19px; font-weight: 600;
  transition: transform .1s ease, background-color .15s ease;
}
.cal button:active:not(:disabled) { transform: scale(.92); }
.cal button:disabled { background: transparent; color: var(--muted); opacity: .4; }
.cal .weekend { color: var(--muted); }
.cal .today { box-shadow: inset 0 0 0 2px var(--steel); }
/* 기록한 날 = 진한 초록 + ✓ (대표님 2026-10-02: 입력한 날과 안 한 날이 한눈에 구분되게) */
.cal .done { background: var(--go); color: #fff; }
.cal .done::after {
  content: ''; position: absolute; right: 5px; top: 5px; width: 8px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}
/* 몰아서 채우려고 고른 날 = 파랑 */
.cal .sel { background: var(--steel); color: #fff; box-shadow: 0 0 0 3px rgba(36, 87, 166, .25); }
.cal-legend { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 14px 0 2px; }
.cal-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }
.lg-done { background: var(--go); } .lg-none { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); } .lg-sel { background: var(--steel); }

/* 몰아서 버튼은 하단 탭 바로 위에 붙는다 */
.dock { position: sticky; bottom: calc(var(--tabs-h) + 12px + env(safe-area-inset-bottom)); z-index: 5; }

/* ── 하단 탭 ─────────────────────────────── */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 8px;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 8px 16px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs button {
  flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 14px;
}
.tabs button.on { color: var(--steel); background: color-mix(in srgb, var(--steel) 10%, transparent); }
.tabs button.on svg { stroke-width: 2.4; }

/* ── 편집기 = 전체 화면 시트 ───────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  background: var(--paper); animation: sheet-in .22s ease-out;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 8px 8px; background: var(--ink); color: #fff;
}
.sheet-head h2 { margin: 0; text-align: center; font-size: 18px; font-weight: 700; }
.sheet-head h2 small { display: block; font-size: 12px; font-weight: 600; color: var(--signal); }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 16px 24px; width: 100%; max-width: 560px; margin: 0 auto; }
.sheet-foot {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line);
}
.sheet-foot > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.label { font-size: 15px; font-weight: 700; margin: 22px 2px 10px; }
.label small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 6px; }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 44px; border-radius: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.chips:empty { display: none; }
.chip {
  min-height: 42px; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text);
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on .n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--signal); color: #1c1600; font-size: 12px; font-weight: 800; }
.chip.on .x { margin-left: 6px; opacity: .6; }

/* 운행 줄: 왼쪽 색 띠 = 목적 */
.row {
  --pc: var(--p-work);
  display: grid; grid-template-columns: 1fr 96px; grid-template-areas: "purpose km" "path path"; gap: 8px;
  background: var(--card); border-radius: 16px; padding: 12px 12px 12px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow); border-left: 5px solid var(--pc);
}
.row[data-p="commute_in"], .row[data-p="commute_out"] { --pc: var(--p-commute); }
.row[data-p="client"] { --pc: var(--p-client); }
.row[data-p="return"] { --pc: var(--p-return); }
.row[data-p="personal"] { --pc: var(--p-personal); }
.row .purpose {
  grid-area: purpose; width: auto; justify-self: start; min-height: 40px; padding: 6px 34px 6px 12px;
  border: none; border-radius: 999px; font-weight: 700; font-size: 15px;
  background-color: color-mix(in srgb, var(--pc) 14%, transparent); color: var(--text);
}
.row .km-wrap { grid-area: km; position: relative; }
.row .km { min-height: 40px; padding: 6px 34px 6px 10px; text-align: right; font-family: var(--num); font-size: 22px; font-weight: 600; }
.row .km-wrap span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.row .path { grid-area: path; display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; gap: 4px; }
.row .path input { min-height: 46px; padding: 10px 12px; font-size: 16px; }
.row .path svg { width: 20px; height: 20px; color: var(--muted); justify-self: center; }

/* ── 계기판 사진 대화상자 = 아래에서 올라오는 시트 ── */
dialog.bottom {
  width: 100%; max-width: 560px; margin: auto auto 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  border: none; border-radius: 24px 24px 0 0; background: var(--card); color: var(--text);
}
dialog.bottom::backdrop { background: rgba(10, 19, 34, .55); backdrop-filter: blur(2px); }
dialog.bottom h3 { margin: 0 0 16px; font-size: 19px; }
dialog.bottom .msg { font-size: 15px; margin: 4px 0 12px; }
dialog.bottom .msg:empty { display: none; }

/* ── 로그인 ───────────────────────────────── */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ink); }
.login-brand { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px 28px 32px; color: #fff; position: relative; }
.login-brand img { border-radius: 16px; margin-bottom: 20px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.login-brand h1 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; }
.login-brand p { margin: 10px 0 0; color: #aebfd6; font-size: 16px; }
.login-brand::after {
  content: ''; position: absolute; right: 36px; top: 0; bottom: 0; width: 3px;
  background: repeating-linear-gradient(to bottom, var(--signal) 0 18px, transparent 18px 34px); opacity: .7;
}
.login-card { background: var(--card); border-radius: 28px 28px 0 0; padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); }
.login-card .fine { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
