* { box-sizing: border-box; }
:root {
  --bg: #f5f6fa; --panel: #fff;
  --border: #e4e6ea; --border-soft: #eef0f3;
  --text: #1f2937; --muted: #6b7280; --muted-2: #9ca3af;
  --primary: #3566d6; --primary-2: #1e4fc1; --primary-soft: #e7eefc;
  --success: #16a34a; --warn: #f59e0b; --danger: #ef4444;
  --header-h: 52px; --gnb-w: 72px; --footer-h: 30px;
}
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.5;
}

/* ── 헤더 ───────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; z-index: 30;
}
.app-header .brand { font-weight: 600; font-size: 14px; margin-left: 6px; color: var(--text); }
.app-header .brand small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.icon-btn { background: transparent; border: 0; color: var(--muted); padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: #f1f3f7; color: var(--text); }
.user-btn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); padding: 6px 10px; border-radius: 4px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.user-btn:hover { border-color: var(--primary); }
.user-btn .grade { color: var(--muted); font-size: 11px; }

/* ── 좌측 GNB (컴팩트 + 텍스트 + 명확한 박스) ──── */
.app-gnb {
  position: fixed; top: var(--header-h); bottom: var(--footer-h); left: 0;
  width: var(--gnb-w); background: #fff; border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden; padding: 6px 6px;
}
.app-gnb a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  margin-bottom: 3px;
  color: var(--muted); text-decoration: none;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 0.12s;
}
.app-gnb a:hover { background: #f1f5f9; color: var(--primary); }
.app-gnb a.active {
  background: var(--primary-soft); color: var(--primary);
  border-left-color: var(--primary);
}
.app-gnb a.active .lbl { font-weight: 700; }
.app-gnb a.disabled { color: var(--muted-2); pointer-events: none; cursor: not-allowed; opacity: 0.55; }
.app-gnb i {
  display: block;
  font-size: 17px; line-height: 1;
}
.app-gnb .lbl {
  display: block;
  font-size: 11px; line-height: 1.2;
  letter-spacing: -0.3px;
  text-align: center;
  font-weight: 500;
}
.app-gnb a[data-soon]::after {
  content: attr(data-soon);
  display: block; margin-top: 2px;
  font-size: 9px; color: var(--muted-2);
  background: #f1f5f9;
  padding: 0 5px; border-radius: 8px;
  width: fit-content; margin-left: auto; margin-right: auto;
}
.app-gnb .gnb-divider {
  height: 1px; background: var(--border);
  margin: 8px 6px;
}
.app-gnb .gnb-group-lbl { display: none; }

/* ── 본문 / 푸터 ──────────────────────────────────── */
.app-main {
  margin-left: var(--gnb-w); margin-top: var(--header-h);
  padding: 14px 18px; padding-bottom: calc(var(--footer-h) + 14px);
}
.page-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.page-title small { font-size: 11px; color: var(--muted); font-weight: 400; }
.app-footer {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--footer-h);
  background: #fafbfc; color: var(--muted); font-size: 11px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-top: 1px solid var(--border); z-index: 20;
}

/* ── 카드 / 폼 ────────────────────────────────────── */
.sec { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.sec-h h3 { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.input, .select, .textarea {
  border: 1px solid var(--border); padding: 5px 9px; font-size: 12px; border-radius: 4px;
  background: #fff; color: var(--text); font-family: inherit; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(53,102,214,0.12); }
.textarea { resize: vertical; }
.btn { border: 1px solid var(--border); background: #fff; padding: 5px 11px; font-size: 12px; border-radius: 4px; cursor: pointer; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); color: #fff; border-color: var(--primary-2); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-sm { padding: 3px 8px; font-size: 11px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f1f3f7; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.filter-bar .input { width: 280px; }
.filter-bar .select { width: 130px; }
.filter-bar .spacer { flex: 1; }
.filter-hint { font-size: 11px; color: var(--muted); padding: 0 4px; margin: -6px 4px 12px; }
.filter-hint .dot { color: var(--border); margin: 0 6px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; border-radius: 8px; overflow: hidden; }
table.tbl th { background: #f7f8fa; padding: 8px 10px; text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.tbl tr:hover td { background: #fafbff; }
table.tbl tr.selected td { background: var(--primary-soft); }
table.tbl tr.drag-over td { background: #fef9c3; }
table.tbl .text-end { text-align: right; }
table.tbl .text-center { text-align: center; }

.badge { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 10px; background: #eef2f7; color: #475569; font-weight: 500; white-space: nowrap; }
.badge.green { background: #dcfce7; color: #14532d; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.badge.orange { background: #fed7aa; color: #9a3412; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.purple { background: #f3e8ff; color: #6b21a8; }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.yellow { background: #fef3c7; color: #92400e; }
.badge.teal { background: #ccfbf1; color: #134e4a; }
/* 새 요구사항 — 3단계 상태 */
.b-사진대기 { background: #f1f5f9; color: #475569; }
.b-사진거부 { background: #fee2e2; color: #991b1b; }
.b-견적대기 { background: #fef3c7; color: #92400e; }
.b-견적발송 { background: #dbeafe; color: #1e40af; }
.b-부재 { background: #f1f5f9; color: #475569; }
.b-수출 { background: #ccfbf1; color: #134e4a; }
.b-매입 { background: #dcfce7; color: #14532d; }
.b-폐차 { background: #fed7aa; color: #9a3412; }
.b-불가 { background: #fee2e2; color: #991b1b; }
.b-수출계약 { background: #c7d2fe; color: #3730a3; }
.b-매입계약 { background: #d1fae5; color: #064e3b; }
.b-폐차계약 { background: #fed7aa; color: #9a3412; }
.b-환불 { background: #fee2e2; color: #991b1b; }
/* 차량 cm_status */
.b-판매중 { background: #dbeafe; color: #1e40af; }
.b-계약중 { background: #fef3c7; color: #92400e; }
.b-판매완료 { background: #dcfce7; color: #14532d; }
.b-대기 { background: #f1f5f9; color: #475569; }

mark { background: #fff3bf; padding: 0 2px; }

/* 모달 */
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 60; }
.modal-ov.open { display: flex; }
.modal-box { background: #fff; border-radius: 8px; max-width: 640px; width: 90%; max-height: 85vh; display: flex; flex-direction: column; }
.modal-box.lg { max-width: 880px; }
.modal-hd { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-hd h3 { margin: 0; font-size: 14px; }
.modal-hd .close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-bd { padding: 14px 16px; overflow-y: auto; }
.modal-ft { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── 알람 시스템 ────────────────────────────────────── */
/* 헤더 종 — 알람 미확인 시 흔들림 + 빨간 점멸 */
@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(-15deg); }
  20% { transform: rotate(13deg); }
  30% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  50% { transform: rotate(-8deg); }
  60% { transform: rotate(5deg); }
  70%, 100% { transform: rotate(0); }
}
@keyframes bell-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
.icon-btn.bell-active { color: var(--danger) !important; animation: bell-shake 1.6s ease-in-out infinite; }
.icon-btn.bell-active .bell-dot { animation: bell-pulse 1.5s ease-out infinite; }

/* 큰 알람 모달 (전체 그레이 + 가운데 강조) */
.alarm-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
  animation: alarm-fade-in 0.2s ease-out;
}
@keyframes alarm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes alarm-pop-in {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes alarm-glow {
  0%, 100% { box-shadow: 0 10px 50px rgba(245, 158, 11, 0.4), 0 0 0 0 rgba(245, 158, 11, 0.6); }
  50% { box-shadow: 0 10px 60px rgba(245, 158, 11, 0.6), 0 0 0 12px rgba(245, 158, 11, 0); }
}
.alarm-popup {
  background: #fff;
  border-radius: 14px;
  width: 460px; max-width: 90vw;
  overflow: hidden;
  animation: alarm-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), alarm-glow 2s ease-in-out infinite 0.4s;
  border: 3px solid #f59e0b;
}
.alarm-popup .ah {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700;
}
.alarm-popup .ah i { font-size: 22px; animation: bell-shake 1.2s ease-in-out infinite; transform-origin: top center; }
.alarm-popup .ab { padding: 18px 20px; }
.alarm-popup .ab .who { font-size: 18px; font-weight: 700; color: var(--text); }
.alarm-popup .ab .who small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.alarm-popup .ab .when {
  display: inline-block; margin-top: 8px;
  background: #fffbeb; color: #92400e;
  padding: 4px 10px; border-radius: 14px;
  font-size: 12px; font-weight: 600;
  border: 1px solid #fde68a;
}
.alarm-popup .ab .body {
  margin-top: 12px; padding: 12px 14px;
  background: #fafbfc; border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 14px; line-height: 1.5; color: var(--text);
}
.alarm-popup .ab .car {
  margin-top: 10px; font-size: 12px; color: var(--muted);
}
.alarm-popup .ab .car b { color: var(--text); }
.alarm-popup .af {
  padding: 12px 20px;
  background: #fafbfc;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.alarm-popup .af .btn { flex: 1; justify-content: center; padding: 9px 12px; font-size: 13px; }
.alarm-popup .ab .more { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: right; }

/* 헤더 알람 드롭다운 (작은 리스트) */
.alarm-dd {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  width: 340px; z-index: 50; display: none;
  max-height: 400px; overflow-y: auto;
}
.alarm-dd.open { display: block; }
.alarm-dd .h { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.alarm-dd .it { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.alarm-dd .it:hover { background: #fafbff; }
.alarm-dd .it:last-child { border-bottom: 0; }
.alarm-dd .it .top { display: flex; justify-content: space-between; align-items: baseline; }
.alarm-dd .it .who { font-weight: 600; font-size: 12.5px; }
.alarm-dd .it .at { font-size: 10.5px; color: var(--muted); font-family: 'Menlo','Consolas',monospace; }
.alarm-dd .it .body { font-size: 11.5px; color: var(--text); margin-top: 2px; line-height: 1.4; }
.alarm-dd .empty { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }

/* 토스트 */
.toast-host { position: fixed; bottom: 50px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 6px; }
.toast { background: #1f2937; color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; min-width: 220px; }
.toast.success { background: var(--success); }
.toast.warn { background: var(--warn); }
.toast .x { background: transparent; border: 0; color: #fff; opacity: 0.7; cursor: pointer; }

/* 드롭다운 */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 4px; min-width: 140px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 6px 10px; font-size: 12px; color: var(--text); text-decoration: none; border-radius: 4px; cursor: pointer; }
.dropdown-menu a:hover { background: #f1f3f7; color: var(--primary); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border-soft); margin: 4px 0; }

/* 그리드 헬퍼 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.between { justify-content: space-between; align-items: center; }
.center { align-items: center; }
.muted { color: var(--muted); }
.text-end { text-align: right; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }

/* 빈 상태 */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 36px; opacity: 0.4; display: block; margin-bottom: 8px; }

/* 통계 카드 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.stat .v { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat .delta { font-size: 11px; color: var(--success); margin-left: 6px; }
.stat .delta.down { color: var(--danger); }

/* 로그인/비번변경 페이지 — pages/auth.css 로 분리 */

/* 차량 카드 */
.veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.veh-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.15s; }
.veh-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: var(--primary); }
.veh-card .img { height: 120px; background: linear-gradient(135deg, #cbd5e1, #94a3b8); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 36px; }
.veh-card .info { padding: 10px 12px; font-size: 12px; }
.veh-card .info .name { font-weight: 600; font-size: 13px; }
.veh-card .info .row { display: flex; justify-content: space-between; color: var(--muted); margin-top: 3px; }
.veh-card .info .price { color: var(--primary); font-weight: 600; }
.dropzone { border: 2px dashed var(--border); border-radius: 6px; padding: 30px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: #f8fafc; color: var(--primary); }

/* 정산 */
.settle-row { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px dashed var(--border-soft); font-size: 12px; }
.settle-row.total { border-top: 2px solid var(--primary); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 14px; border-bottom: 0; }
.settle-row .pos { color: var(--success); }
.settle-row .neg { color: var(--danger); }

/* 바이어 */
.buyer-card { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: #fff; }
.buyer-card h4 { margin: 0 0 4px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.buyer-card .country { font-size: 16px; }

/* ============================================================
   Utility 클래스 — 인라인 style 제거용
   ============================================================ */
/* 폰트 크기 */
.fs-10  { font-size: 10px; }
.fs-105 { font-size: 10.5px; }
.fs-11  { font-size: 11px; }
.fs-115 { font-size: 11.5px; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.fs-14  { font-size: 14px; }
.fs-15  { font-size: 15px; }

/* 색상 */
.c-muted   { color: var(--muted); }
.c-muted2  { color: var(--muted-2); }
.c-text    { color: var(--text); }
.c-primary { color: var(--primary); }
.c-success { color: var(--success); }
.c-danger  { color: var(--danger); }
.c-warn    { color: var(--warn); }

/* 폰트 무게 */
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* margin / padding
   ★ 기존 `.mt-2`(8px) `.mt-3`(12px) `.mb-2`(8px) `.mb-3`(12px) Bootstrap-style spacer는 그대로 유지.
   ★ 신규 px 정확값 utility는 `.mtpx-N` / `.mbpx-N` prefix 사용 (충돌 방지) */
.mtpx-2  { margin-top: 2px; }
.mtpx-4  { margin-top: 4px; }
.mtpx-6  { margin-top: 6px; }
.mtpx-10 { margin-top: 10px; }
.mtpx-14 { margin-top: 14px; }

.mbpx-2  { margin-bottom: 2px; }
.mbpx-4  { margin-bottom: 4px; }
.mbpx-6  { margin-bottom: 6px; }
.mbpx-10 { margin-bottom: 10px; }

.ml-auto { margin-left: auto; }
.mlpx-6  { margin-left: 6px; }
.mr-auto { margin-right: auto; }

.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.p-empty { padding: 60px 20px; }       /* 빈 상태 박스 */
.p-empty-sm { padding: 30px 20px; }
.cell-pad { padding: 5px 8px; }        /* 작은 셀(상태 표시 등) */
.p-40 { padding: 40px; }
.p-60 { padding: 60px; }
.cursor-pointer { cursor: pointer; }
.overflow-auto { overflow: auto; }

/* flex */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-end     { display: flex; justify-content: flex-end; align-items: center; }
.flex-start   { display: flex; align-items: flex-start; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* gap (flex/grid 공용) */
.gap-2  { gap: 2px; }
.gap-3  { gap: 3px; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }

/* grid */
.col-full { grid-column: 1 / -1; }

/* 컴포넌트 */
.pager-host { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.label-mini { font-size: 11px; color: var(--muted); margin-bottom: 2px; display: block; }
.muted-meta { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.5; }
.muted-line { font-size: 10.5px; color: var(--muted); font-weight: 400; }

/* 자주 쓰는 input/select 너비 */
.w-90  { width: 90px; }
.w-130 { width: 130px; }
.w-140 { width: 140px; }
.w-160 { width: 160px; }
.w-200 { width: 200px; }
.w-220 { width: 220px; }
.w-240 { width: 240px; }

/* 모노스페이스 */
.mono { font-family: 'Menlo', 'Consolas', 'Malgun Gothic', monospace; }

/* min-width 0 — flex/grid 자식 overflow 방지 */
.min-w-0 { min-width: 0; }

/* sec 플러시 — 내부 테이블/리스트가 sec 가장자리까지 차도록 */
.sec-flush { padding: 0; overflow: hidden; }
@media (max-width: 900px) {
  /* 모바일에선 .sec-flush 안의 테이블이 가로 스크롤되게 — 운영관리(본부/팀/사원/매체) 등 */
  .sec-flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sec-flush > table.tbl { min-width: 720px; }
}

/* 위치/유틸리티 추가 — 단순 view 인라인 제거용 */
.relative { position: relative; }
.no-underline { text-decoration: none; }
.color-inherit { color: inherit; }
.fs-9  { font-size: 9px; }
.fs-20 { font-size: 20px; }
.fs-32 { font-size: 32px; }
.fs-48 { font-size: 48px; }
.lh-17 { line-height: 1.7; }
.m-0 { margin: 0; }
.mlpx-14 { margin-left: 14px; }
.mlpx-18 { margin-left: 18px; }
.h-28 { height: 28px; }
.overflow-x-auto { overflow-x: auto; }
.d-block { display: block; }
.text-center { text-align: center; }
.w-60   { width: 60px; }
.w-100  { width: 100px; }
.w-420  { width: 420px; }
.maxw-480 { max-width: 480px; }
.maxw-520 { max-width: 520px; }
.p-14   { padding: 14px; }
.p-80-20 { padding: 80px 20px; }
.p-30-12 { padding: 30px 12px; }
.uppercase-track { text-transform: uppercase; letter-spacing: 0.5px; }
.h4-tight { margin: 0 0 8px; }
.m-403 { margin: 14px 0 6px; }

/* 추가 utility (P2 인라인 0) */
.w-36 { width: 36px; }
.w-48 { width: 48px; }
.w-80 { width: 80px; }
.w-120 { width: 120px; }
.maxw-420 { max-width: 420px; }
.maxw-440 { max-width: 440px; }
.min-h-50 { min-height: 50px; }
.min-h-80 { min-height: 80px; }
.min-h-280 { min-height: 280px; }
.self-center { align-self: center; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.bg-readonly-soft { background: #fafbfc; }
.color-muted-3 { color: #9ca3af; }
.c-deep-red { color: #991b1b; }
.c-deep-slate { color: #475569; }
.month-label { min-width: 120px; text-align: center; }
.swatch.s-alarm { background: #fef3c7; border: 1px solid #f59e0b; }
.swatch.s-late  { background: #fee2e2; border: 1px solid #ef4444; }

/* dbmaster recall 종류 라디오 라벨 */
.recall-kind-label {
  font-size: 12.5px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 4px;
  cursor: pointer;
}
.recall-kind-info {
  background: #fafbfc; padding: 8px 10px;
  border: 1px solid var(--border-soft); border-radius: 4px;
  font-size: 11.5px; margin-bottom: 10px;
}

/* DB 검색 결과 항목 (calendar) */
.db-result-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

/* db-search-result host (calendar) */
.db-search-result-host {
  max-height: 280px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 4px;
}

/* 헤더 알람 dot 위치/스타일 */
.app-header .bell-dot {
  position: absolute; top: 2px; right: 2px;
  background: #ef4444; color: #fff;
  font-size: 9px; padding: 1px 5px; border-radius: 8px;
  display: none;
}

/* dropdown 메뉴 안 button (로그아웃 등 — 모든 인라인 통합) */
.dropdown-menu-btn {
  all: unset;
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

/* 알림 배너 — 노랑 (관리회사 안내 등) */
.alert-warn {
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  color: #92400e;
}

/* sec-h 위/아래 마진 + 점선 구분 */
.sec-h-divider {
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

/* pager 페이지 active 버튼 (renderPager의 동적 ternary 대체) */
.btn.pager-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   공통 반응형 — 페이지 인라인 스타일 덮어쓰기 (구 layout/main.php inline)
   ============================================================ */

/* 햄버거 버튼 / 백드롭 — 데스크톱에선 숨김 */
.gnb-toggle { display: none; }
.gnb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 25; }
body.gnb-open .gnb-backdrop { display: block; }

@media (max-width: 1280px) {
  /* 좌·우 split → 1열 stacking
     ★ minmax(0, 1fr) — 자식 min-content (큰 테이블 등)가 column 폭을 끌어올리지 못하게.
     1fr만 쓰면 자식 min-content > viewport일 때 column이 viewport 초과 → 다른 형제도 같이 늘어남 */
  .lead-split, .cal-split, .settle-split { grid-template-columns: minmax(0, 1fr) !important; }
  .lead-wrap { max-height: none !important; }
  .det { position: static !important; height: auto !important; min-height: 0 !important; }
}

@media (max-width: 900px) {
  /* GNB 좁히기 */
  :root { --gnb-w: 56px; }
  .app-gnb a { padding: 8px 2px; }
  .app-gnb .lbl { font-size: 9px; }
  .app-gnb i { font-size: 16px; }

  .stat-row { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .modal-box.lg { max-width: 95vw !important; }
  .parse-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar > * { flex-shrink: 0; }
  .lead-wrap { overflow-x: auto !important; }
  .form-tbl th { width: 60px !important; font-size: 10.5px !important; padding: 4px 6px !important; }
  /* group-tabs 부모를 정산 좌측 wrapper에 가두고, 자식이 부모 폭에 맞도록 */
  .group-tabs { width: 100%; min-width: 0; }
  .group-tabs .group-tab { min-width: 0; }

  /* 헤더 — DB등록 버튼들의 텍스트 숨기고 아이콘만 (공간 절약) */
  .header-add-btns .lbl { display: none; }
  .header-add-btns .btn { padding: 5px 9px !important; }
}

@media (max-width: 640px) {
  :root { --header-h: 50px; }

  /* 헤더 — 햄버거만 보이고 다른 건 숨김 또는 축소 */
  .gnb-toggle { display: inline-flex !important; align-items: center; justify-content: center; }
  .header-home { display: none; }
  .app-header .brand { font-size: 12.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* DB등록 3종 — 좁은 화면에서도 노출, 아이콘만 (.lbl은 900px부터 이미 숨김) */
  .header-add-btns { gap: 3px !important; margin-left: 8px !important; }
  .header-add-btns .btn { padding: 5px 7px !important; }
  .user-btn .user-name { display: none; }
  .user-btn .grade { font-size: 10px; }
  .user-btn { padding: 5px 8px !important; }

  /* GNB는 평소 숨김 → 햄버거 클릭으로 슬라이드 인 */
  .app-gnb {
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    width: 200px !important;
    z-index: 35;
    bottom: 0 !important;
  }
  .app-gnb a { flex-direction: row !important; justify-content: flex-start !important; padding: 10px 14px !important; gap: 10px !important; }
  .app-gnb a .lbl { font-size: 13px !important; font-weight: 500 !important; text-align: left !important; }
  .app-gnb i { font-size: 18px !important; }
  body.gnb-open .app-gnb { transform: translateX(0); }

  .app-main { margin-left: 0 !important; padding: 10px 12px !important; }
  .stat-row { grid-template-columns: minmax(0, 1fr) !important; }
  .veh-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr) !important; }
  .modal-box, .modal-box.lg { max-width: 100vw !important; margin: 0 !important; height: 100vh; border-radius: 0 !important; }
  /* group-tabs는 wrap이 아닌 *자식 폭 균등 축소* — 4개 모두 한 줄에 보이게 */
  .group-tabs { flex-wrap: nowrap; }
  .group-tabs .group-tab { font-size: 11px !important; padding: 6px 4px !important; }

  /* form-tbl 1열 */
  .form-tbl, .form-tbl tbody, .form-tbl tr, .form-tbl th, .form-tbl td { display: block; width: 100% !important; }
  .form-tbl th { background: #f4f6f8; padding: 4px 8px; border: 0; text-align: left; }
  .form-tbl td { border: 1px solid var(--border); }
}

/* admin: 카운터 클릭 링크 + 사원/팀 모달 리스트 */
.link-btn { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--primary-dark, #1d4ed8); }
.member-group { display: flex; flex-direction: column; gap: 10px; }
.member-block { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.member-block-h { padding: 8px 12px; background: #fafbff; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.member-ul { list-style: none; padding: 6px 12px; margin: 0; font-size: 12.5px; }
.member-ul li { padding: 4px 0; border-bottom: 1px dashed var(--border-soft); }
.member-ul li:last-child { border-bottom: 0; }
.p-8 { padding: 8px 12px; }

/* 알람 도달 — 화면 가운데 큰 모달 (자동 사라짐) */
.alarm-pop-ov {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 11000;
  animation: alarmFade 0.18s ease-out;
}
.alarm-pop {
  background: #fff; border-radius: 12px; width: 420px; max-width: 92vw;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  padding: 22px 24px 18px; text-align: center;
  border-top: 6px solid #f59e0b;
  animation: alarmPop 0.22s cubic-bezier(.2,.9,.3,1.4);
}
.alarm-pop .alarm-pop-h {
  font-size: 14px; color: #92400e; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 8px;
}
.alarm-pop .alarm-pop-h i { font-size: 18px; }
.alarm-pop .alarm-pop-name { font-size: 20px; font-weight: 700; color: #1f2937; margin-bottom: 4px; word-break: keep-all; }
.alarm-pop .alarm-pop-body { font-size: 13.5px; color: #334155; line-height: 1.5; word-break: keep-all; }
.alarm-pop.is-late { border-top-color: #ef4444; }
.alarm-pop.is-late .alarm-pop-h { color: #991b1b; }
.alarm-pop-actions {
  margin-top: 18px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.alarm-pop-actions .btn {
  font-size: 12px; padding: 7px 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.alarm-pop-actions .btn i { font-size: 12px; }
@keyframes alarmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes alarmPop { 0% { transform: translateY(-12px) scale(.96); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }

/* digest 모달 — 도달한 알람 N건을 한 모달에 모아 표시 */
.alarm-pop.alarm-pop-digest { width: 640px; max-width: 96vw; padding: 18px 20px 14px; text-align: left; }
.alarm-pop-digest .alarm-pop-h { justify-content: flex-start; font-size: 15px; }
.alarm-pop-digest-body { max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.alarm-digest-it {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  display: grid; grid-template-columns: 1fr 130px; gap: 4px 12px; align-items: center;
}
.alarm-digest-it.is-overdue { border-left: 3px solid #ef4444; background: #fef2f2; }
.alarm-digest-meta { grid-column: 1; grid-row: 1; font-size: 13px; color: #1f2937; }
.alarm-digest-meta b { font-size: 14px; }
.alarm-digest-meta small { color: #94a3b8; margin-left: 6px; font-weight: 400; }
.alarm-digest-it .alarm-digest-body { grid-column: 1; grid-row: 2; font-size: 12.5px; color: #475569; word-break: keep-all; }
.alarm-digest-actions {
  grid-column: 2; grid-row: 1 / 3;
  display: flex; flex-direction: column; gap: 4px;
  align-self: center; justify-self: end;
}
.alarm-digest-actions .btn { width: 100%; font-size: 12px; padding: 6px 8px; white-space: nowrap; justify-content: center; }
.alarm-pop-digest .alarm-pop-actions { grid-template-columns: 1fr 1fr; margin-top: 12px; }

/* 모바일 — digest 행을 1열로 stack, 버튼은 가로로 두 개 */
@media (max-width: 640px) {
  .alarm-pop.alarm-pop-digest { width: 100%; max-width: 100vw; max-height: 100vh; border-radius: 0; padding: 14px 14px 12px; }
  .alarm-pop-digest-body { max-height: calc(100vh - 160px); }
  .alarm-digest-it { grid-template-columns: 1fr; gap: 6px; }
  .alarm-digest-meta, .alarm-digest-it .alarm-digest-body { grid-column: 1; }
  .alarm-digest-actions { grid-column: 1; grid-row: auto; flex-direction: row; justify-self: stretch; gap: 6px; }
  .alarm-digest-actions .btn { width: auto; flex: 1; }
  .alarm-pop-digest .alarm-pop-actions { grid-template-columns: 1fr; gap: 6px; }
}
/* 헤더 드롭다운 mute 칩 */
.hdr-alarm-mute { font-size: 11px; padding: 3px 8px; }
.hdr-alarm-mute.is-muted { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.hdr-alarm-mute.is-snoozed { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* toast 메시지 영역 (inline style 제거 후) */
.toast .toast-msg { flex: 1; }

/* 헤더 알람 드롭다운 (inline style 제거 후) */
.hdr-alarm-empty-i { font-size: 24px; color: var(--success); display: block; margin-bottom: 6px; }
.hdr-alarm-cal { font-size: 10px; padding: 2px 6px; }
.hdr-alarm-phone { font-weight: 400; color: var(--muted); }
.hdr-alarm-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

/* 모바일 — 알람 드롭다운 */
@media (max-width: 640px) {
  .alarm-dd {
    position: fixed; top: var(--header-h, 56px); right: 0; left: 0;
    width: 100vw; max-width: 100vw; margin-top: 0;
    max-height: calc(100vh - var(--header-h, 56px)); border-radius: 0;
  }
  .alarm-dd .h { flex-wrap: wrap; gap: 6px; }
  .alarm-dd .it .top { flex-wrap: wrap; gap: 4px; }
  .alarm-dd .it .who { font-size: 13px; }
  .hdr-alarm-actions .btn { flex: 1 1 auto; min-width: 0; padding: 6px 8px; font-size: 11px; }
}
#alarmDd .it .at.is-late { color: #ef4444; font-weight: 600; }

/* 중복 DB(db_jungbok='중복') — 모든 리스트(DB관리/배분/회수/휴지통)에서 행 강조 */
tr.is-jungbok > td { background: #fff5f5; }
tr.is-jungbok.active > td { background: #fee2e2; }
