/* 네이티브 앱(WebView) — 입점사·관리자 대시보드 모바일 레이아웃 */

.scar-native-app {
  overflow-x: hidden;
}

html.scar-native-app.scar-public-shell,
.scar-native-app.scar-public-shell body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.scar-native-app.scar-dash-shell,
.scar-native-app.scar-dash-shell body {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

.scar-native-app.scar-public-shell #app {
  overflow-y: visible;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.scar-native-app.scar-public-shell .kiosk-root {
  overflow-y: visible;
}

.scar-native-app.scar-dash-shell #app {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 상태바·노치 아래로 콘텐츠 시작 */
.scar-native-app.scar-public-shell {
  padding-top: 0;
}

.scar-native-app.scar-public-shell #header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.scar-native-app.scar-public-shell #app {
  padding-top: 0;
}

.scar-native-app.scar-public-shell .header-inner--native-public,
.scar-native-app.scar-public-shell .header-inner {
  height: auto !important;
  min-height: 0;
  align-items: stretch;
  overflow: visible;
}

.scar-native-app.scar-public-shell .header-inner--native-public {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 4px) 12px 8px !important;
}

.scar-native-app.scar-public-shell .header-inner--native-public .logo {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.scar-native-app.scar-public-shell .header-actions--native-top {
  position: relative;
  z-index: 2;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
}

.scar-native-app.scar-public-shell .header-inner--native-public .logo {
  width: 100%;
  margin: 0;
  padding: 0;
}

.scar-native-app.scar-public-shell .header-actions--native-top {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px !important;
  width: 100%;
  order: 2;
}

.scar-native-app.scar-dash-shell .dealer-wrap,
.scar-native-app.scar-dash-shell .adm-wrap {
  padding-top: 4px;
}

/* 공개 홈 — 모바일 헤더·버튼 줄바꿈 */
.scar-native-app.scar-public-shell .header-inner {
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px !important;
}

.scar-native-app.scar-public-shell .nav-links {
  order: 3;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 4px !important;
  padding-bottom: 2px;
}

.scar-native-app.scar-public-shell .nav-link {
  font-size: 13px !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.scar-native-app.scar-public-shell .header-search {
  display: none !important;
}

.scar-native-app.scar-public-shell .header-actions {
  flex-shrink: 0;
  gap: 4px !important;
}

.scar-native-app.scar-public-shell .header-actions .btn-login,
.scar-native-app.scar-public-shell .header-actions .btn-partner-center,
.scar-native-app.scar-public-shell .header-actions .btn-logout {
  font-size: 12px !important;
  padding: 6px 10px !important;
}

/* 공개 홈 — 헤더만, 푸터·회사소개 숨김 (회사소개는 /about) */
.scar-native-app.scar-public-shell #header {
  display: block !important;
}
.scar-native-app.scar-public-shell footer {
  display: none !important;
}

.scar-native-app.scar-public-shell .kiosk-root {
  min-height: auto !important;
  padding-top: 8px !important;
}

/* 입점사·관리자 대시보드 — Flutter 상단바 + 하단 탭만 사용 */
.scar-native-app.scar-dash-shell #header,
.scar-native-app.scar-dash-shell footer {
  display: none !important;
}

.scar-native-app #app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── 입점사 ── */
.scar-native-app .dealer-wrap {
  flex-direction: column !important;
  min-height: 100dvh;
}

.scar-native-app .dealer-side,
.scar-native-app .adm-side {
  display: none !important;
}

.scar-native-app .dealer-wrap,
.scar-native-app .adm-wrap {
  display: flex !important;
  flex-direction: column !important;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
}

.scar-native-app .dealer-main,
.scar-native-app .adm-main {
  flex: 1;
  min-height: 0;
  width: 100% !important;
  max-width: 100% !important;
  padding: 8px 10px 12px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.scar-native-app #dealer-content,
.scar-native-app #admin-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* 앱 하단 4탭 */
.scar-app-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.scar-app-bottom-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 10px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  color: #6b7280;
}

.scar-app-bottom-btn.active {
  color: #1a2b49;
  font-weight: 700;
}

.scar-app-bottom-emoji {
  font-size: 20px;
  line-height: 1;
}

.scar-app-bottom-label {
  font-size: 10px;
  letter-spacing: -0.02em;
}

.scar-app-page-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 4px;
}

.scar-app-page-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 14px;
}

.scar-app-car-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scar-app-car-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.scar-app-car-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.scar-app-car-plate {
  font-family: ui-monospace, monospace;
  font-weight: 800;
  font-size: 15px;
  background: #142033;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
}

.scar-app-car-model {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.scar-app-car-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.scar-app-car-gps {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 12px;
  line-height: 1.5;
}

.scar-app-car-gps--empty {
  color: #9ca3af;
}

.scar-app-car-link {
  border: none;
  background: none;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
}

.scar-app-car-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.scar-app-car-group-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.scar-app-car-obd {
  font-size: 11px;
  color: #64748b;
}

.scar-app-car-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scar-app-car-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.scar-app-back-bar {
  margin-bottom: 12px;
}

.scar-app-car-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #374151;
}

.scar-app-car-btn--ok {
  background: #ecfdf5;
  border-color: #86efac;
  color: #065f46;
}

.scar-app-car-btn--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.scar-app-car-hint {
  font-size: 12px;
  color: #9ca3af;
}

.scar-app-car-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.scar-app-car-search {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
}

.scar-app-empty {
  text-align: center;
  padding: 32px 16px;
  color: #9ca3af;
  font-size: 14px;
}

.scar-native-app .scar-car-subtabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #f8f9fa;
  padding: 8px 0 10px;
  margin: -8px 0 12px !important;
}

.scar-native-app .d-modal-box {
  max-height: min(88dvh, 720px) !important;
  overflow-y: auto !important;
  margin: 12px !important;
}

.scar-native-app .d-modal-bg {
  align-items: flex-start !important;
  padding-top: 8px !important;
}

/* ── 관리자·입점사 콘텐츠 모바일 타이포·폼 ── */
.scar-native-app .adm-h2,
.scar-native-app .dealer-h2 {
  font-size: 17px !important;
  line-height: 1.35 !important;
  margin-bottom: 10px !important;
}

.scar-native-app .adm-h3,
.scar-native-app .dealer-h3 {
  font-size: 14px !important;
}

.scar-native-app .adm-section {
  max-width: 100%;
  overflow-x: hidden;
}

.scar-native-app .adm-section-head {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
}

.scar-native-app .adm-section-head > div,
.scar-native-app .adm-filter-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
}

.scar-native-app input[type="text"],
.scar-native-app input[type="search"],
.scar-native-app input[type="number"],
.scar-native-app input[type="tel"],
.scar-native-app input[type="date"],
.scar-native-app select,
.scar-native-app textarea {
  font-size: 16px !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.scar-native-app .adm-filter-btn {
  font-size: 12px !important;
  padding: 8px 12px !important;
  min-height: 36px;
}

.scar-native-app .adm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 4px 0;
  max-width: 100vw;
}

.scar-native-app .adm-table {
  font-size: 12px !important;
  min-width: 520px;
}

.scar-native-app .adm-table th,
.scar-native-app .adm-table td {
  padding: 8px 10px !important;
  white-space: nowrap;
}

.scar-native-app table {
  max-width: 100%;
}

.scar-native-app .dealer-section,
.scar-native-app .adm-section > div[style*="display:flex"] {
  max-width: 100%;
}

.scar-native-app .quote-card,
.scar-native-app [style*="border-radius:12px"][style*="padding:16px"] {
  max-width: 100% !important;
  box-sizing: border-box;
}

.scar-native-app .today-counter-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

.scar-native-app button,
.scar-native-app .btn,
.scar-native-app .adm-filter-btn {
  touch-action: manipulation;
}

.scar-native-app .scar-hub-wrap {
  padding: 2px 0 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.scar-native-app .scar-hub-wrap--admin .scar-hub-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.scar-native-app .scar-hub-wrap--admin .scar-hub-badge {
  min-height: 62px;
  padding: 8px 4px;
}

.scar-native-app .scar-hub-wrap--admin .scar-hub-label {
  font-size: 11px;
}

.scar-native-app .scar-hub-wrap--admin .scar-hub-icon {
  font-size: 18px;
}

.scar-native-app .scar-hub-wrap--admin .scar-hub-summary {
  margin-bottom: 10px;
  padding: 10px 12px;
}

.scar-native-app .scar-hub-summary {
  background: #E8E2D9;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.scar-native-app .scar-hub-summary-title {
  font-size: 15px;
  font-weight: 800;
  color: #1A2B49;
  margin-bottom: 8px;
}

.scar-native-app .scar-hub-summary-desc {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.scar-native-app .scar-hub-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 13px;
  color: #374151;
}

.scar-native-app .scar-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scar-native-app .scar-hub-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 8px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.scar-native-app .scar-hub-icon {
  font-size: 22px;
  line-height: 1;
}

.scar-native-app .scar-hub-label {
  font-size: 12px;
  font-weight: 700;
  color: #1A2B49;
  margin-top: 6px;
  text-align: center;
  line-height: 1.25;
}

.scar-native-app .scar-hub-sub {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
}

.scar-native-app .dealer-side--legacy {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  min-height: auto !important;
  max-height: none !important;
  flex-direction: column !important;
  padding: 0 !important;
  border-right: none !important;
  border-top: 1px solid #e5e7eb;
  background: #fff !important;
  z-index: 200;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.scar-native-app .dealer-side .dealer-logo,
.scar-native-app .dealer-side .dealer-name,
.scar-native-app .dealer-side > div:last-child {
  display: none !important;
}

.scar-native-app .dealer-nav--full {
  display: none !important;
}

.scar-native-app .dealer-nav--mobile {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 6px 4px !important;
  gap: 4px !important;
  margin: 0 !important;
}

.scar-native-app .dealer-nav--mobile .dnav-btn {
  flex: 1 0 auto !important;
  min-width: 56px !important;
  max-width: 72px !important;
  font-size: 11px !important;
  padding: 8px 6px !important;
  white-space: nowrap;
}

.scar-native-app .dealer-more-sheet {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  align-items: flex-end;
}

.scar-native-app .dealer-more-sheet.open {
  display: flex !important;
}

.scar-native-app .dealer-more-panel {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
}

.scar-native-app .dealer-more-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.scar-native-app .today-counter-grid {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
}

.scar-native-app .today-counter-val {
  font-size: 18px !important;
}

.scar-native-app .dealer-native-menu-hint {
  display: block;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #E8E2D9;
  border: 1px solid #d4cfc6;
  border-radius: 10px;
  font-size: 12px;
  color: #1A2B49;
  line-height: 1.45;
  cursor: pointer;
}

/* ── 관리자 ── */
.scar-native-app .adm-wrap {
  flex-direction: column !important;
}

.scar-native-app .adm-main {
  padding: 12px 12px 76px !important;
}

.scar-native-app .adm-side {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  height: auto !important;
  flex-direction: column !important;
  padding: 0 !important;
  z-index: 200;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
}

.scar-native-app .adm-side .adm-logo,
.scar-native-app .adm-side .adm-user,
.scar-native-app .adm-side > div:last-child {
  display: none !important;
}

.scar-native-app .adm-nav--full {
  display: none !important;
}

.scar-native-app .adm-nav--mobile {
  display: flex !important;
  flex-direction: row !important;
  overflow-x: auto !important;
  padding: 6px 4px !important;
  gap: 4px !important;
}

.scar-native-app .adm-nav--mobile .anav-btn {
  flex: 1 0 auto !important;
  min-width: 64px !important;
  font-size: 11px !important;
  padding: 8px 6px !important;
  white-space: nowrap;
}

.scar-native-app .adm-more-sheet {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  align-items: flex-end;
}

.scar-native-app .adm-more-sheet.open {
  display: flex !important;
}

.scar-native-app .adm-more-panel {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  background: #1e293b;
  color: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
}

.scar-native-app .adm-more-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

/* Field Hub */
.scar-field-wrap {
  padding: 12px 14px calc(72px + env(safe-area-inset-bottom, 0px));
  min-height: 100%;
  box-sizing: border-box;
}

.scar-field-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scar-field-top-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

.scar-field-points {
  font-size: 14px;
  font-weight: 700;
  color: #1A2B49;
  background: #eff6ff;
  padding: 6px 12px;
  border-radius: 20px;
}

.scar-field-points--low {
  background: #fef2f2;
  color: #dc2626;
}

.scar-field-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}

.scar-field-summary b {
  color: #111827;
  font-size: 16px;
}

.scar-field-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
}

.scar-field-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.scar-field-card-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.scar-field-card-body {
  flex: 1;
  min-width: 0;
}

.scar-field-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.scar-field-card-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.scar-field-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scar-field-card-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  cursor: pointer;
  font-family: inherit;
}

.scar-field-card-btn--primary {
  background: #1A2B49;
  color: #fff;
  border-color: #1A2B49;
}

.scar-field-empty {
  text-align: center;
  padding: 24px;
  color: #9ca3af;
  font-size: 14px;
}

.scar-field-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
}

.scar-field-bar-btn {
  flex: 1;
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  padding: 6px 2px;
  font-family: inherit;
}

.scar-field-bar-btn.active {
  color: #1A2B49;
}

.scar-hub-badge--back {
  grid-column: 1 / -1;
  background: #f3f4f6 !important;
  font-weight: 700;
}
