:root {
  --bg: #0b1220;
  --panel: #0f1a2e;
  --panel2: #0c172a;
  --card: #0e1a30;
  --text: #e9eefc;
  --muted: #a8b3d6;
  --line: rgba(255, 255, 255, 0.1);
  --line2: rgba(255, 255, 255, 0.14);
  --brand: #5aa6ff;
  --brand2: #2f7cf6;
  --good: #37d67a;
  --warn: #ffd057;
  --bad: #ff5a73;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --r: 16px;
  --r2: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      1200px 600px at 15% 5%,
      rgba(90, 166, 255, 0.22),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 90% 10%,
      rgba(55, 214, 122, 0.18),
      transparent 55%
    ),
    linear-gradient(180deg, #081024 0%, #070d19 60%, #060a14 100%);
}

a {
  color: inherit;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 16px 44px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(15, 26, 46, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, #86f1ff 120%);
  box-shadow: 0 10px 18px rgba(90, 166, 255, 0.25);
  position: relative;
  flex: 0 0 auto;
}

.logo:after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  opacity: 0.65;
}

.brand h1 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand p {
  margin: 3px 0 0 0;
  font-size: 12px;
  color: var(--muted);
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 18, 34, 0.55);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.12);
}

/* Layout */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(15, 26, 46, 0.68);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  /* background: rgba(12, 23, 42, 0.55); */
}

.card-hd .title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.badge {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: rgba(233, 238, 252, 0.9);
  background: rgba(10, 18, 34, 0.45);
  white-space: nowrap;
}

.title h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.title span {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-top: 2px;
  max-width: 55ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  /* background: rgba(10, 18, 34, 0.55); */
  min-height: 42px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

select,
input[type="file"],
input[type="text"] {
  border: 1;
  /* outline: none;
  background: transparent; */
  color: var(--text);
  font-size: 13px;
  min-width: 80px;
  width: 88%;
}

input[type="file"] {
  min-width: 240px;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 1px solid var(--line2);
  /* background: rgba(12, 23, 42, 0.55); */
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  transition:
    0.15s transform,
    0.15s border-color,
    0.15s background;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(90, 166, 255, 0.55);
  background: rgba(15, 30, 55, 0.65);
}

.btn:active {
  transform: translateY(0px);
}

.btn.primary {
  background: linear-gradient(
    135deg,
    rgba(90, 166, 255, 0.25),
    rgba(47, 124, 246, 0.18)
  );
  border-color: rgba(90, 166, 255, 0.45);
}

.btn.good {
  border-color: rgba(55, 214, 122, 0.45);
  background: linear-gradient(
    135deg,
    rgba(55, 214, 122, 0.16),
    rgba(10, 18, 34, 0.45)
  );
}

.btn.ghost {
  background: transparent;
}

.hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbd {
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(10, 18, 34, 0.35);
  color: rgba(233, 238, 252, 0.85);
}

/* Map + List split */
.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  padding: 14px;
}

@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
  }

  .hint {
    margin-left: 0;
    width: 100%;
  }

  input[type="file"] {
    min-width: 190px;
  }
}

.mapbox {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background:
    radial-gradient(
      800px 400px at 20% 10%,
      rgba(90, 166, 255, 0.14),
      transparent 60%
    ),
    radial-gradient(
      600px 350px at 80% 20%,
      rgba(55, 214, 122, 0.1),
      transparent 55%
    ),
    linear-gradient(180deg, rgba(10, 18, 34, 0.55), rgba(10, 18, 34, 0.35));
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.mapbox .map-hint {
  position: absolute;
  left: 124px;
  top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
  color: rgba(233, 238, 252, 0.92);
}

.pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pin {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(90, 166, 255, 0.12);
  opacity: 0.95;
}

.pin.good {
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(55, 214, 122, 0.12);
}

.pin.warn {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(255, 208, 87, 0.12);
}

.mapbox .center {
  position: absolute;
  left: 30%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(233, 238, 252, 0.85);
  width: 90%;
}

.mapbox .center h3 {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.mapbox .center p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.mapbox .legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, 0.55);
}

.legend .row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(233, 238, 252, 0.9);
  font-size: 12px;
  white-space: nowrap;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(90, 166, 255, 0.12);
}

.swatch.good {
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.12);
}

.swatch.warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(255, 208, 87, 0.12);
}

/* Side panel */
.side {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: rgba(10, 18, 34, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.side .side-hd {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 23, 42, 0.45);
}

.side .side-hd .kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.kpi .k {
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, 0.45);
  border-radius: 16px;
  padding: 10px 12px;
}

.k .n {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.k .t {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.side .side-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.biz {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(15, 26, 46, 0.35);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.biz .l {
  min-width: 0;
}

.biz .name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.2px;
  margin: 0;
}

.biz .meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tagrow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, 0.35);
  color: rgba(233, 238, 252, 0.92);
}

.tag.good {
  border-color: rgba(55, 214, 122, 0.35);
  background: rgba(55, 214, 122, 0.12);
}

.tag.warn {
  border-color: rgba(255, 208, 87, 0.35);
  background: rgba(255, 208, 87, 0.1);
}

.biz .actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}

.btn.sm {
  padding: 8px 10px;
  min-height: 36px;
  border-radius: 12px;
  font-size: 12px;
}

/* Table list */
.tablewrap {
  padding: 0;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  /* background: rgba(12, 23, 42, 0.45); */
}

.table-tools .search {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  /* background: rgba(10, 18, 34, 0.55); */
}

.table-tools .search input {
  width: 100%;
  min-width: 0;
  color: var(--text);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}

.table th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  background: rgba(10, 18, 34, 0.35);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table td .sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}

.table td:last-child {
  white-space: nowrap;
}

.table tr:hover td {
  background: rgba(90, 166, 255, 0.06);
}

/* Modal (pure CSS demo) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modal {
  width: min(1100px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(
      900px 420px at 20% 0%,
      rgba(90, 166, 255, 0.18),
      transparent 55%
    ),
    linear-gradient(180deg, rgba(15, 26, 46, 0.92), rgba(10, 18, 34, 0.92));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-hd h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.modal-hd .addr {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.xbtn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, 0.45);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.modal-bd {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 860px) {
  .modal-bd {
    grid-template-columns: 1fr;
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 18, 34, 0.45);
  padding: 12px;
}

.panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(233, 238, 252, 0.92);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 26, 46, 0.28);
  color: rgba(233, 238, 252, 0.92);
  font-size: 13px;
}

.row .small {
  color: var(--muted);
  font-size: 12px;
}

.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(15, 26, 46, 0.28);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 12px;
  min-height: 110px;
  resize: vertical;
  outline: none;
  font-size: 13px;
  line-height: 1.5;
}

.filedrop {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(10, 18, 34, 0.25);
  border-radius: 18px;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filelist {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(15, 26, 46, 0.28);
  font-size: 12px;
  color: rgba(233, 238, 252, 0.92);
}

.file .meta {
  color: var(--muted);
}

.modal-ft {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Demo checkbox trigger */
#openModal {
  display: none;
}

#openModal:checked ~ .modal-backdrop {
  display: flex;
}
/* checkbox 방식이 DOM 구조에 의해 깨져도 열리도록 fallback */
.modal-backdrop.is-open {
  display: flex;
}

/* =========================================================
   GFP Dialog Modal (Force)
   ========================================================= */

/* dialog 기본 스타일(작은 박스/여백/테두리)을 완전히 무력화 + 크기 강제 */
dialog.gfp-dialog {
  margin: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  width: min(1000px, calc(100% - 36px)) !important;
  max-width: calc(100% - 36px) !important;
  color: inherit;
}

/* 백드롭(뒤 배경) */
dialog.gfp-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* dialog 내부 카드(우리가 원하던 모달 UI) */
dialog.gfp-dialog .modal {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(
      900px 420px at 20% 0%,
      rgba(90, 166, 255, 0.18),
      transparent 55%
    ),
    linear-gradient(180deg, rgba(15, 26, 46, 0.92), rgba(10, 18, 34, 0.92));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* 헤더/본문/푸터는 이전 모달 CSS 그대로 강제 */
dialog.gfp-dialog .modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
dialog.gfp-dialog .modal-hd h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.2px;
}
dialog.gfp-dialog .modal-hd .addr {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

dialog.gfp-dialog .xbtn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, 0.45);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

dialog.gfp-dialog .modal-bd {
  padding: 14px 16px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;

  /* ✅ 내용이 “안 보이는 것처럼” 되는 대표 원인: 높이/오버플로우 */
  max-height: min(70vh, 720px);
  overflow: auto;
}
@media (max-width: 860px) {
  dialog.gfp-dialog .modal-bd {
    grid-template-columns: 1fr;
  }
}

dialog.gfp-dialog .panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 18, 34, 0.45);
  padding: 12px;
}
dialog.gfp-dialog .panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(233, 238, 252, 0.92);
}

dialog.gfp-dialog .rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

dialog.gfp-dialog .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 26, 46, 0.28);
  color: rgba(233, 238, 252, 0.92);
  font-size: 13px;
}
dialog.gfp-dialog .row .small {
  color: var(--muted);
  font-size: 12px;
}

dialog.gfp-dialog .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(15, 26, 46, 0.28);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 12px;
  min-height: 110px;
  resize: vertical;
  outline: none;
  font-size: 13px;
  line-height: 1.5;
}

dialog.gfp-dialog .filedrop {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(10, 18, 34, 0.25);
  border-radius: 18px;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

dialog.gfp-dialog .modal-ft {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
/*=== ✅ 페이지 전체가 스크롤 되도록 (내부 스크롤 금지) */
html,
body {
  height: auto !important;
  overflow-y: auto !important;
}

body {
  overflow-x: hidden !important;
}

/* 혹시 wrap/card/split을 100vh로 고정해둔 경우 풀기 */
.wrap,
.card,
.split,
.mapbox,
.side,
.side-body,
.tablewrap {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* 테이블도 내부 스크롤 없이 아래로 늘어나게 */
.table-container {
  overflow: visible !important;
  max-height: none !important;
}

/* 만약 우측 리스트가 따로 스크롤 되도록 되어 있으면 해제 */
.side-body {
  overflow: visible !important;
  max-height: none !important;
}
/* /* ✅ 페이지 전체가 스크롤 되도록 (내부 스크롤 금지) =====*/

/* KPI */
.gfp-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.gfp-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.gfp-kpi-card .t {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}
.gfp-kpi-card .v {
  font-size: 22px;
  font-weight: 800;
  color: blueviolet;
}

/* Visit list */
.gfp-visitbox {
  margin-top: 12px;
  background: rgba(15, 26, 46, 0.28);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.gfp-visitbox-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
}
.gfp-visitlist table {
  width: 100%;
  border-collapse: collapse;
}
.gfp-visitlist th,
.gfp-visitlist td {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  text-align: left;
  width: 20%;
}
.gfp-visitlist th {
  color: #64748b;
  font-weight: 700;
}

.gfp-quick-add-wrap {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #fff;
}

@media (max-width: 768px) {
  .gfp-quick-add-wrap {
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
  }
}
