/* ==========================================================================
   필드메이트 — 외국인 농업 인력 매칭·관리 시스템
   디자인 시스템 (서버 렌더링 + 소량의 바닐라 JS)
   ========================================================================== */

:root {
  --ink: #12211a;
  --ink-2: #3c4f45;
  --muted: #75877c;
  --line: #e3eae5;
  --line-strong: #cfdad3;
  --bg: #f3f6f4;
  --card: #ffffff;

  --green-950: #08231a;
  --green-900: #0d3326;
  --green-800: #12452f;
  --green-700: #1a5c40;
  --green-600: #22754f;
  --green-500: #2f8f62;
  --green-100: #e7f2eb;
  --green-50: #f2f9f4;

  --gold: #e8a71b;
  --gold-600: #c98a0a;
  --gold-100: #fdf2d8;

  --blue: #2b6cb0;
  --blue-100: #e8f0fa;
  --red: #c0392b;
  --red-100: #fdecea;
  --amber: #b7791f;
  --amber-100: #fdf3e2;
  --slate: #5b6b62;
  --slate-100: #eef1ef;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-1: 0 1px 2px rgba(16, 40, 28, .06), 0 1px 3px rgba(16, 40, 28, .04);
  --shadow-2: 0 8px 24px -12px rgba(12, 45, 30, .28), 0 2px 6px rgba(12, 45, 30, .05);
  --shadow-3: 0 24px 60px -24px rgba(8, 40, 26, .45);
  --sidebar-w: 248px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo',
    'Malgun Gothic', 'Noto Sans KR', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
svg { flex: none; }

/* ---------- 공통 유틸 ---------- */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; }

/* ---------- 배지 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: -.01em;
  line-height: 1.55; white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--slate { background: var(--slate-100); color: var(--slate); }
.badge--green { background: var(--green-100); color: var(--green-700); }
.badge--amber { background: var(--amber-100); color: var(--amber); }
.badge--blue { background: var(--blue-100); color: var(--blue); }
.badge--red { background: var(--red-100); color: var(--red); }
.badge--gold { background: var(--gold-100); color: var(--gold-600); }
.badge--outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 700; letter-spacing: -.01em;
  border: 1px solid transparent; transition: .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--green-700); color: #fff; box-shadow: 0 1px 2px rgba(10, 50, 32, .25); }
.btn--primary:hover { background: var(--green-600); }
.btn--ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--green-500); color: var(--green-700); background: var(--green-50); }
.btn--soft { background: var(--green-100); color: var(--green-700); }
.btn--soft:hover { background: #dbeee3; }
.btn--danger { background: var(--red-100); color: var(--red); }
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

/* ---------- 폼 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: -.01em; }
.field .hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14px; color: var(--ink); transition: .16s ease; outline: none;
}
.textarea { height: auto; min-height: 78px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #a7b5ac; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47, 143, 98, .13);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2375877c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.checkline { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.check-chip input { accent-color: var(--green-600); width: 14px; height: 14px; }
.check-chip:has(input:checked) { background: var(--green-100); border-color: var(--green-500); color: var(--green-700); }

/* ---------- 카드 / 패널 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card__title { font-size: 14.5px; font-weight: 800; letter-spacing: -.02em; }
.card__body { padding: 18px 20px; }
.card__body--tight { padding: 12px 16px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfdfb; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; padding: 10px 14px; background: #fafcfa;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fbfdfb; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 로그인 ---------- */
.auth {
  min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--green-950);
}
.auth__brand {
  position: relative; overflow: hidden; padding: 56px; color: #eaf5ee;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 520px at 8% 0%, rgba(47,143,98,.55), transparent 62%),
    radial-gradient(700px 460px at 88% 96%, rgba(232,167,27,.22), transparent 60%),
    linear-gradient(160deg, #0b2f22 0%, #08231a 60%, #061b14 100%);
}
.auth__brand::after {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 1px, transparent 1px 26px);
  pointer-events: none;
}
.auth__logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.auth__logo .mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(47,143,98,.9), rgba(232,167,27,.65));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px -6px rgba(0,0,0,.6);
  color: #06281b;
}
.auth__copy h1 {
  font-size: clamp(30px, 3.4vw, 46px); line-height: 1.24; font-weight: 800;
  letter-spacing: -.045em; margin-bottom: 18px;
}
.auth__copy h1 em { font-style: normal; color: #f0c368; }
.auth__copy p { font-size: 15px; line-height: 1.75; color: #a9c6b6; max-width: 30em; }
.auth__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.1); border-radius: 16px; overflow: hidden; }
.auth__stats div { padding: 16px 18px; background: rgba(6, 27, 20, .55); }
.auth__stats b { display: block; font-size: 22px; letter-spacing: -.03em; color: #fff; }
.auth__stats span { font-size: 11.5px; color: #8fb3a1; }
.auth__panel {
  display: grid; place-items: center; padding: 40px;
  background: #f6f8f6;
}
.auth__card { width: 100%; max-width: 400px; }
.auth__card h2 { font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.auth__card > p { margin-top: 7px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.auth__form { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.demo-box { margin-top: 22px; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 14px; background: #fbfcfb; }
.demo-box .demo-title { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; margin-bottom: 9px; }
.demo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.demo-row:first-of-type { border-top: none; }
.demo-row code { font-size: 12px; background: var(--green-50); color: var(--green-700); padding: 2px 6px; border-radius: 5px; }

.alert { display: flex; gap: 9px; padding: 11px 13px; border-radius: 10px; font-size: 12.5px; line-height: 1.55; }
.alert--error { background: var(--red-100); color: #8f2b21; }
.alert--info { background: var(--green-50); color: var(--green-700); border: 1px solid #d5e9dd; }

/* ==========================================================================
   백오피스 (인력사무소 · PC)
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: linear-gradient(180deg, #0c3125 0%, #08231a 100%);
  color: #c9dcd2; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.sidebar__brand .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, #2f8f62, #c9901a); color: #06281b;
}
.sidebar__brand b { color: #fff; font-size: 14.5px; letter-spacing: -.02em; display: block; }
.sidebar__brand span { font-size: 10.5px; color: #7fa694; letter-spacing: .04em; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; color: #5f8474; padding: 14px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: #b6cdc1; transition: .14s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(47,143,98,.28); color: #fff; box-shadow: inset 0 0 0 1px rgba(110,190,150,.25); }
.nav-item svg { opacity: .85; }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.13);
  padding: 1px 7px; border-radius: 999px; color: #dff0e6;
}
.sidebar__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.05); }
.side-user .avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(47,143,98,.35); color: #fff; font-size: 12.5px; font-weight: 800;
}
.side-user b { display: block; font-size: 12.5px; color: #f0f7f3; }
.side-user span { font-size: 10.5px; color: #86a999; }
.side-logout { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #7fa694; padding: 9px 10px 0; }
.side-logout:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 32px; height: 64px; background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: 16.5px; font-weight: 800; letter-spacing: -.03em; }
.topbar__crumb { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.content { padding: 26px 32px 56px; max-width: 1440px; width: 100%; }

/* 좁은 화면 전용 메뉴 요소 — PC 에서는 표시하지 않는다 */
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__heading { min-width: 0; }
.topbar__menu, .sidebar__close, .nav-backdrop { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -.04em; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.55; }

/* 지표 카드 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden; padding: 17px 18px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.stat__label { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat__value { font-size: 30px; font-weight: 800; letter-spacing: -.045em; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat__sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.stat--accent { background: linear-gradient(150deg, #14503a, #0b2d21); border-color: transparent; color: #fff; }
.stat--accent .stat__label, .stat--accent .stat__sub { color: #9dc0ae; }
.stat--accent .stat__value { color: #fff; }
.stat--gold { background: linear-gradient(150deg, #fdf6e6, #fbf0d4); border-color: #f2e2ba; }
.stat--gold .stat__value { color: #8a5f05; }
.stat__spark { position: absolute; right: -6px; bottom: -6px; opacity: .12; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 오더 카드(대시보드) */
.job { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: none; padding-top: 2px; }
.job__date {
  width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--green-50);
  border: 1px solid #dcebe2; padding: 6px 0;
}
.job__date b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.03em; color: var(--green-800); }
.job__date span { font-size: 10px; color: var(--muted); font-weight: 700; }
.job__main { min-width: 0; flex: 1; }
.job__title { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.job__meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.job__meta span { display: inline-flex; align-items: center; gap: 4px; }

/* 필터 바 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 320px; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.seg { display: inline-flex; padding: 3px; background: #eaf0ec; border-radius: 10px; gap: 2px; }
.seg a, .seg button {
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.seg a.active, .seg button.active { background: #fff; color: var(--green-800); box-shadow: var(--shadow-1); }
.seg .n { font-size: 11px; color: var(--muted); margin-left: 4px; font-weight: 700; }

/* 좌우 상세 레이아웃 */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.kv dd { margin: 0; line-height: 1.6; }
.note-box { background: var(--green-50); border: 1px solid #dcebe2; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.65; color: var(--green-800); }
.amount-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 12.5px; }
.amount-row:first-child { border-top: none; }
.amount-total { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 12px; border-top: 1.5px solid var(--line-strong); font-weight: 800; }
.amount-total b { font-size: 19px; letter-spacing: -.03em; color: var(--green-800); font-variant-numeric: tabular-nums; }

/* 근로자 아바타 */
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .ava {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--green-100); color: var(--green-700); font-weight: 800; font-size: 12.5px;
  letter-spacing: -.02em; text-transform: uppercase;
}
.who .ava--gold { background: var(--gold-100); color: var(--gold-600); }
.who .ava--slate { background: var(--slate-100); color: var(--slate); }
.who b { display: block; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.who span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* 얼굴 사진 썸네일 (선택 항목) — 없으면 이름 첫 글자 */
.ava--face {
  flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--green-100); color: var(--green-700);
  font-weight: 800; font-size: 12.5px; letter-spacing: -.02em; text-transform: uppercase;
  border: 1px solid rgba(18, 69, 47, .08);
}
.ava--face.ava--gold { background: var(--gold-100); color: var(--gold-600); }
.ava--face.ava--slate { background: var(--slate-100); color: var(--slate); }
.ava--photo { object-fit: cover; background: #eef2ef; color: transparent; }

/* 숙련도 바 */
.skill { display: flex; align-items: center; gap: 8px; min-width: 104px; }
.skill__bar { flex: 1; height: 6px; border-radius: 99px; background: #e9efeb; overflow: hidden; }
.skill__bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3aa374, #1a5c40); }
.skill b { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.skill--lg .skill__bar { height: 8px; }
.skill--lg b { font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px;
  background: #f2f6f3; border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
}
.chip--skill { background: var(--green-50); border-color: #d8ebe0; color: var(--green-700); }

.empty { display: grid; place-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty svg { opacity: .4; }
.empty b { color: var(--ink-2); font-size: 13.5px; }
.empty span { font-size: 12.5px; max-width: 26em; line-height: 1.6; }

/* 모달 */
dialog.sheet {
  border: none; padding: 0; border-radius: var(--r-xl); width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px); background: #fff; box-shadow: var(--shadow-3);
  color: var(--ink); overflow: hidden;
}
dialog.sheet::backdrop { background: rgba(7, 30, 21, .5); backdrop-filter: blur(3px); }
dialog.sheet .sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
dialog.sheet .sheet__head h3 { font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
dialog.sheet .sheet__body { padding: 20px 22px; overflow-y: auto; max-height: calc(100dvh - 220px); }
dialog.sheet .sheet__foot { padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfdfb; display: flex; justify-content: flex-end; gap: 8px; }
dialog.sheet[draggable] { touch-action: none; }

/* 토스트 */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #0f3527; color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow-3); z-index: 1000;
  opacity: 0; pointer-events: none; transition: .22s ease; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #8f2b21; }

/* ==========================================================================
   현장 관리자 (모바일 · PWA)
   ========================================================================== */
.m-app {
  max-width: 520px; margin: 0 auto; min-height: 100dvh;
  background: var(--bg); position: relative; padding-bottom: 92px;
  box-shadow: 0 0 0 1px var(--line);
}
.m-head {
  position: sticky; top: 0; z-index: 30; padding: calc(14px + env(safe-area-inset-top)) 18px 16px;
  background: linear-gradient(165deg, #14503a 0%, #0b2d21 100%); color: #fff;
  border-radius: 0 0 22px 22px; box-shadow: 0 10px 26px -18px rgba(5, 35, 22, .9);
}
.m-head__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.m-head__hello { font-size: 12px; color: #9dc0ae; font-weight: 600; }
.m-head h1 { font-size: 20px; font-weight: 800; letter-spacing: -.04em; margin-top: 3px; }
.m-head__date { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #a8c8b7; margin-top: 6px; }
.m-head__actions { display: flex; gap: 7px; }
.m-btn-circle {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.12); color: #eaf5ee; border: 1px solid rgba(255,255,255,.14);
}
.m-btn-circle:hover { background: rgba(255,255,255,.2); }
.m-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.m-summary div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 9px 10px; }
.m-summary b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.m-summary span { font-size: 10.5px; color: #a3c4b3; font-weight: 600; }

.m-body { padding: 16px 16px 0; }
.m-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 2px 10px; }
.m-section-title h2 { font-size: 13.5px; font-weight: 800; letter-spacing: -.02em; }
.m-section-title span { font-size: 11.5px; color: var(--muted); }

.job-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 15px; margin-bottom: 11px; box-shadow: var(--shadow-1); transition: .15s ease;
}
.job-card:hover { border-color: #c6ded1; box-shadow: var(--shadow-2); }
.job-card--active { border-color: var(--green-500); box-shadow: 0 0 0 2px rgba(47,143,98,.12), var(--shadow-1); }
.job-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.job-card__tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--green-700); letter-spacing: .01em; }
.job-card h3 { font-size: 16px; font-weight: 800; letter-spacing: -.035em; }
.job-card__farm { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.job-card__facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }
.job-card__facts span { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.job-card__progress { margin-top: 11px; display: flex; align-items: center; gap: 8px; }
.progressline { flex: 1; height: 6px; border-radius: 99px; background: #eaf0ec; overflow: hidden; }
.progressline i { display: block; height: 100%; background: linear-gradient(90deg, #4bb083, #1a5c40); border-radius: 99px; transition: width .3s ease; }
.job-card__progress b { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.m-tabs { position: sticky; top: 0; z-index: 25; display: flex; gap: 4px; padding: 10px 16px; background: rgba(243,246,244,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.m-tabs::-webkit-scrollbar { display: none; }
.m-tabs a { padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.m-tabs a.active { background: #fff; color: var(--green-800); box-shadow: var(--shadow-1); }

.m-back {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); padding: 12px 16px 0;
}

.m-detail-head { padding: 4px 16px 16px; }
.m-detail-head .tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--green-700); }
.m-detail-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.045em; margin-top: 6px; line-height: 1.3; }
.m-detail-head .farm { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

.m-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 15px; margin-bottom: 12px; box-shadow: var(--shadow-1); }
.m-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.m-card__head h2 { font-size: 13.5px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 7px; }
.m-card__head h2 svg { color: var(--green-600); }
.m-fact { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f4f1; }
.m-fact:first-of-type { border-top: none; padding-top: 0; }
.m-fact__icon { width: 26px; height: 26px; border-radius: 8px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex: none; }
.m-fact__k { font-size: 11px; color: var(--muted); font-weight: 700; }
.m-fact__v { font-size: 13.5px; font-weight: 600; margin-top: 2px; line-height: 1.5; letter-spacing: -.01em; }

.crew-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #f0f4f1; }
.crew-row:first-of-type { border-top: none; padding-top: 0; }
.crew-row:last-child { padding-bottom: 0; }
.crew-row__body { flex: 1; min-width: 0; }
.crew-row__name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.crew-row__meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.attend-btn {
  height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 700; color: var(--ink-2); background: #fff; white-space: nowrap;
}
.attend-btn.on-present { background: var(--green-100); border-color: var(--green-500); color: var(--green-700); }
.attend-btn.on-late { background: var(--amber-100); border-color: #ecc98a; color: var(--amber); }
.attend-btn.on-absent { background: var(--red-100); border-color: #efc0ba; color: var(--red); }

/* 출근 배지 (값별 색) */
.attend-badge { display: inline-flex; }
.attend-badge--pending { background: var(--slate-100); color: var(--slate); }
.attend-badge--present { background: var(--green-100); color: var(--green-700); }
.attend-badge--late { background: var(--amber-100); color: var(--amber); }
.attend-badge--absent { background: var(--red-100); color: var(--red); }

/* 조 편성 인원 요약 */
.crew-count { display: flex; align-items: center; gap: 13px; padding: 12px 13px; background: var(--green-50); border: 1px solid #dcebe2; border-radius: 13px; }
.crew-count__now { display: flex; align-items: baseline; gap: 3px; flex: none; }
.crew-count__now b { font-size: 27px; font-weight: 800; letter-spacing: -.05em; color: var(--green-800); line-height: 1; font-variant-numeric: tabular-nums; }
.crew-count__now span { font-size: 12.5px; font-weight: 700; color: var(--green-700); }
.crew-count__body { flex: 1; min-width: 0; }
.crew-count__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--green-800); font-weight: 600; margin-bottom: 6px; }
.crew-count__label b { font-weight: 800; }
.crew-count__short { color: var(--red); font-size: 11.5px; font-weight: 800; flex: none; }
.crew-count__ok { display: inline-flex; align-items: center; gap: 3px; color: var(--green-600); font-size: 11.5px; font-weight: 800; flex: none; }
.crew-count__foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--green-700); margin-top: 6px; }
.crew-count__foot b { font-weight: 800; font-variant-numeric: tabular-nums; }

.crew-list { margin-top: 12px; }
.crew-x {
  width: 21px; height: 21px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted); display: grid; place-items: center; flex: none;
}
.crew-x:hover { background: var(--red-100); border-color: #efc0ba; color: var(--red); }

/* 근로자 추가 */
.crew-add { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line-strong); }
.crew-add__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.crew-add__head b { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; letter-spacing: -.01em; }
.crew-add__head b svg { color: var(--green-600); }
.crew-cands { display: grid; gap: 7px; }
.crew-cand {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.crew-cand:hover { border-color: var(--green-500); background: #fbfefc; }
.crew-cand__body { flex: 1; min-width: 0; }
.crew-cand__body .crew-row__name { gap: 5px; }
.crew-cand__role {
  width: auto; height: 30px; padding: 0 24px 0 9px; font-size: 12px; font-weight: 700;
  border-radius: 8px; flex: none; background-position: right 7px center;
}
.crew-cand__add { flex: none; height: 30px; padding: 0 10px; font-size: 12px; }
/* 체류자격 '확인 필요' 경고 + 이용 기관 확인 체크 */
.crew-cands .crew-cand:has(.visa-warn) { flex-wrap: wrap; }
.visa-warn { margin-top: 5px; padding: 6px 8px; border-radius: 8px; background: #fff8ea; border: 1px solid #f1d9a6; }
.visa-ack { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; line-height: 1.45; color: var(--ink, #1d2a22); cursor: pointer; }
.visa-ack input { width: 15px; height: 15px; flex: none; margin-top: 1px; accent-color: var(--green-600); }
.crew-ack-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fff8ea; border: 1px solid #f1d9a6; }
.crew-blocked { margin-top: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.crew-blocked > summary {
  padding: 9px 12px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  cursor: pointer; list-style: none;
}
.crew-blocked > summary::-webkit-details-marker { display: none; }
.crew-blocked > summary::before { content: '▸ '; }
.crew-blocked[open] > summary::before { content: '▾ '; }
.crew-blocked__row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.crew-blocked__row b { display: block; font-size: 12.5px; font-weight: 700; }
.crew-blocked__row span.tiny { display: block; margin-top: 1px; }

/* 필요 인원 조정 (현장) */
.req-adjust { margin-top: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfb; }
.req-adjust__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.req-adjust__head b { font-size: 12.5px; font-weight: 800; letter-spacing: -.01em; }
.req-adjust__row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.req-btn {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--green-700);
  font-size: 20px; font-weight: 700; line-height: 1; display: grid; place-items: center;
}
.req-btn:hover:not(:disabled) { background: var(--green-50); border-color: var(--green-500); }
.req-btn:disabled { opacity: .4; }
.req-adjust__val {
  flex: 1; text-align: center; display: flex; align-items: baseline; justify-content: center; gap: 4px;
  padding: 4px 0; background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.req-adjust__val b { font-size: 19px; font-weight: 800; color: var(--green-800); font-variant-numeric: tabular-nums; }
.req-adjust__val span { font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* 결근 · 대체 추천 */
.absent-box {
  margin-top: 11px; padding: 11px 12px; border-radius: 12px;
  background: #fdf6f4; border: 1px solid #f3d7d2;
}
.absent-box__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.absent-box__head b { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: #8f2b21; }
.absent-box__head span { font-size: 11px; color: #a8675d; font-weight: 700; }
.crew-cand--reco { background: #fff; }

/* 변경 기록 */
.change-log { margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.change-log > summary {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; list-style: none;
}
.change-log > summary::-webkit-details-marker { display: none; }
.change-log[open] > summary { margin-bottom: 8px; color: var(--green-700); }
.change-log__body { display: grid; gap: 7px; max-height: 240px; overflow-y: auto; }
.change-log__row { display: flex; align-items: flex-start; gap: 8px; }
.change-log__kind {
  flex: none; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800;
  background: var(--slate-100); color: var(--slate); white-space: nowrap; margin-top: 1px;
}
.change-log__kind--add { background: var(--green-100); color: var(--green-700); }
.change-log__kind--remove { background: var(--red-100); color: var(--red); }
.change-log__kind--replace { background: var(--blue-100); color: var(--blue); }
.change-log__kind--required { background: var(--amber-100); color: var(--amber); }
.change-log__main { font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.change-log__reason { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; line-height: 1.45; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-tile {
  position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden; background: #eef2ef;
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile a { display: block; width: 100%; height: 100%; }
/* 사진 삭제 버튼 (사진 타일 우상단) */
/* 어두운 사진·밝은 사진 어디서나 보이도록 흰 바탕 + 빨간 아이콘 + 그림자, 사진마다 항상 표시 */
.photo-del {
  position: absolute; top: 5px; right: 5px; z-index: 2; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  background: #fff; border: 1px solid rgba(0,0,0,.18); color: var(--red);
  box-shadow: 0 1px 4px rgba(0,0,0,.35); opacity: 1; visibility: visible;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.photo-del:hover { background: var(--red); border-color: var(--red); color: #fff; transform: scale(1.06); }
.photo-del:active { transform: scale(.96); }
.photo-del[disabled] { opacity: .5; cursor: default; }
/* 사진 + 아래 촬영 정보 */
.photo-item { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.photo-cap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.photo-cap__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.photo-cap__line { font-size: 10.5px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.photo-cap__line--sub { opacity: .85; }
.geo-tag {
  display: inline-flex; align-items: flex-start; gap: 3px; max-width: 100%; padding: 3px 6px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; overflow-wrap: anywhere;
}
.geo-tag svg { flex: none; margin-top: 1px; }
.geo-tag--near { background: var(--green-100); color: var(--green-700); }
.geo-tag--far { background: var(--red-100); color: var(--red); }
.geo-tag--none, .geo-tag--nofarm { background: var(--slate-100); color: var(--slate); }
.geo-tag--album { background: var(--blue-100); color: var(--blue); }
/* 사진 추가 버튼 (사진 찍기 / 앨범에서 고르기 선택창을 연다) */
.photo-add-wrap { min-width: 0; }
button.photo-add { width: 100%; cursor: pointer; font-family: inherit; text-align: center; line-height: 1.3; padding: 6px; }
/* 사진 고르기 선택창 */
dialog.photo-choose { width: min(360px, calc(100vw - 32px)); padding: 0; border: none; border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(8,40,26,.55); }
dialog.photo-choose::backdrop { background: rgba(7, 30, 21, .5); }
.photo-choose__head { padding: 16px 18px 6px; font-size: 15px; font-weight: 800; letter-spacing: -.03em; }
.photo-choose__sub { padding: 0 18px 10px; font-size: 12px; color: var(--muted); }
.photo-choose__body { display: grid; gap: 8px; padding: 6px 14px 14px; }
.photo-choose__btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: #fff; font: inherit; font-size: 14.5px; font-weight: 800; color: var(--ink); cursor: pointer; text-align: left;
}
.photo-choose__btn:hover, .photo-choose__btn:focus-visible { border-color: var(--green-500); background: var(--green-50); outline: none; }
.photo-choose__btn small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.photo-choose__cancel { margin: 0 14px 14px; }
.photo-add {
  aspect-ratio: 1; border-radius: 11px; border: 1.5px dashed var(--line-strong); background: #fbfdfb;
  display: grid; place-items: center; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700;
}
.photo-add:hover { border-color: var(--green-500); color: var(--green-700); background: var(--green-50); }

.gps-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--green-50); border: 1px solid #d8ebe0; font-size: 11.5px; font-weight: 700; color: var(--green-700); }

/* 하단 탭바 */
.m-tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 40;
  box-shadow: 0 -8px 24px -18px rgba(8,40,26,.5);
}
.m-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
  font-size: 10.5px; font-weight: 700; color: var(--muted); border-radius: 10px;
}
.m-tab.active { color: var(--green-700); }
.m-tab.active svg { color: var(--green-700); }

/* 별점 */
.stars { display: inline-flex; gap: 3px; }
.stars button { padding: 2px; color: #d8e2db; transition: .12s ease; }
.stars button.on { color: var(--gold); }
.stars--sm button svg { width: 15px; height: 15px; }
.stars--lg button svg { width: 27px; height: 27px; }

/* 평가 시트 */
.eval-worker { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.eval-worker:first-of-type { border-top: none; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.score-row .lbl { width: 64px; font-size: 12px; font-weight: 700; color: var(--ink-2); }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 0 16px; height: 58px; }

  /* 메뉴 버튼(≡) — 왼쪽 위 */
  .topbar__menu {
    display: inline-grid; place-items: center; flex: none;
    width: 42px; height: 42px; margin-left: -6px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--ink, #14231b); cursor: pointer;
  }
  .topbar__menu:active { background: #eef3f0; }
  .topbar__title, .topbar__crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 왼쪽 메뉴: 기본은 화면 밖, 열리면 슬라이드 */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(82vw, 292px); height: 100dvh;
    padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom));
    transform: translateX(-102%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: none; overscroll-behavior: contain;
  }
  body.nav-open .sidebar {
    transform: translateX(0); visibility: visible;
    transition: transform .22s ease, visibility 0s;
    box-shadow: 8px 0 32px rgba(0,0,0,.35);
  }
  .sidebar__close {
    display: grid; place-items: center; position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 10px;
    width: 36px; height: 36px; border-radius: 9px; border: 0; cursor: pointer;
    background: rgba(255,255,255,.08); color: #dff0e6;
  }
  .nav-item { padding: 12px 12px; font-size: 14.5px; }   /* 손가락으로 누르기 쉬운 높이 */
  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(5,20,14,.52); opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility 0s linear .22s;
  }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; transition: opacity .22s ease, visibility 0s; }
  body.nav-open { overflow: hidden; }
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__panel { min-height: 100dvh; padding: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .stat__value { font-size: 25px; }
}

/* ==========================================================================
   휴대폰 너비(640px 이하) 운영자 화면 — 카드 1칸 · 표를 카드형으로 쌓기
   (PC·태블릿 너비 규칙은 건드리지 않는다)
   ========================================================================== */
@media (max-width: 640px) {
  /* 농가 카드: 1칸. 이름·전화번호·주소가 잘리거나 끊기지 않게 */
  .farm-grid { grid-template-columns: minmax(0, 1fr); }
  .farm-grid dd { min-width: 0; }
  .farm-grid dd.small { word-break: keep-all; overflow-wrap: anywhere; }
  .farm-grid .chip { white-space: nowrap; max-width: 100%; }

  /* 요약 카드(단가 옵션·외부 연동): 3칸 → 1칸 */
  .stats--3 { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }

  /* 상태 탭: 글자가 세로로 쪼개지지 않게 한 줄 + 필요하면 가로 스크롤 */
  .toolbar .seg { display: flex; width: 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .seg a, .seg button { flex: none; white-space: nowrap; padding: 6px 9px; }

  /* 표 → 카드형(행마다 1장, 항목명: 값)
     ※ 기존 `table.data td` 규칙(padding 13px 14px 등)보다 우선하도록 선택자를 table.data.data--stack 으로 쓴다 */
  .table-wrap--stack { overflow-x: visible; }
  table.data.data--stack, table.data.data--stack tbody, table.data.data--stack tr, table.data.data--stack td { display: block; width: 100%; }
  table.data.data--stack thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  table.data.data--stack tbody tr { position: relative; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.data.data--stack tbody tr:last-child { border-bottom: none; }
  table.data.data--stack tbody tr:hover { background: transparent; }
  table.data.data--stack td {
    position: relative; padding: 6px 0 6px 100px; border-bottom: none; min-height: 30px;
    white-space: normal; max-width: none !important; text-align: left; vertical-align: top;
  }
  table.data.data--stack td.num { text-align: left; }
  table.data.data--stack td::before {
    content: attr(data-label); position: absolute; left: 0; top: 8px; width: 92px;
    font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.4;
  }
  /* 라벨이 필요 없는 칸: 이름 칸(머리글 역할) · 빈 라벨(상세/삭제 버튼) */
  table.data.data--stack td[data-label=""], table.data.data--stack td[data-label="근로자"] { padding-left: 0; }
  table.data.data--stack td[data-label=""]::before, table.data.data--stack td[data-label="근로자"]::before { display: none; }
  table.data.data--stack td[data-label=""] { text-align: left !important; padding-top: 8px; }
  .data--stack td a[href^="tel:"] { white-space: nowrap; }
  .data--stack .chip, .data--stack .badge { white-space: nowrap; }
  /* 근로자 이름 아래 부가 설명(국적·언어·한국어 수준)은 잘라내지 않고 줄바꿈 */
  .data--stack .who .truncate { white-space: normal; overflow: visible; text-overflow: clip; }
  /* 조 편성 후보 표: 체크박스는 카드 오른쪽 위로 */
  table.data.data--stack#crew-candidates tbody tr { padding-right: 52px; }
  table.data.data--stack#crew-candidates td[data-label=""] { position: absolute; right: 14px; top: 12px; width: auto; padding: 0; min-height: 0; }

  /* 정산 미리보기: 금액이 두 줄로 꺾이지 않게 */
  .amount-row { gap: 12px; }
  .amount-row > span:first-child { min-width: 0; }
  .amount-row > .mono { flex: none; white-space: nowrap; }
}

/* 아주 좁은 화면(480px 이하): 상단바 제목이 '근로자 …'처럼 잘리지 않도록 '오늘 작업 N건' 배지는 숨긴다
   (같은 정보가 대시보드 첫 카드에 있다) */
@media (max-width: 480px) {
  .topbar > .row > .badge { display: none; }
  .topbar > .row { flex: none; }
}

/* 인쇄(작업 지시서) */
@media print {
  .sidebar, .topbar, .nav-backdrop, .m-tabbar, .no-print, .m-head, .m-back { display: none !important; }
  body, .m-app, .shell { background: #fff; box-shadow: none; }
  .content { padding: 0; }
}
.visa-warn--row { flex-basis: 100%; margin-top: 2px; }
