@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@300;400;600;700&family=IBM+Plex+Sans:wght@300;400;600;700&display=swap");

:root {
  --ink: #1f2a24;
  --muted: #5c6b64;
  --accent: #2f6f4e;
  --accent-soft: #d7eadc;
  --paper: #f7f4ef;
  --card: #ffffff;
  --grid: #e2e2de;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans KR", "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #f6efe5 0%, #f1f6f3 40%, #e6efe7 100%);
}

.page {
  max-width: 1680px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--grid);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  box-shadow: 0 8px 20px rgba(41, 60, 48, 0.08);
  width: fit-content;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--grid);
  background: #f4f7f2;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
}

.status-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ghost-btn {
  border: 1px solid var(--grid);
  background: #f4f7f2;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}

.ghost-btn:hover {
  background: #e8f1ea;
  color: var(--accent);
}

.ghost-btn.active {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: #c3d8c8;
}

.reset-btn:hover {
  background: #e8f1ea;
  color: var(--accent);
}

.reset-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.table-wrap {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--grid);
  overflow: visible;
  box-shadow: 0 18px 40px rgba(36, 53, 43, 0.08);
  animation: fadeIn 0.6s ease-out;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1400px;
  table-layout: fixed;
}

thead tr:first-child th {
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--grid);
}

thead tr:first-child th[data-group="단지정보"] {
  background: #f6cfd0;
}

thead tr:first-child th[data-group="전고점 정보"] {
  background: #cfe0ff;
}

thead tr:first-child th[data-group="시세"] {
  background: #fff1c9;
}

thead tr:nth-child(2) th {
  background: #f8f9f6;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--grid);
  position: relative;
}

th,
td {
  padding: 10px 12px;
  border-right: 1px solid var(--grid);
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  overflow: visible;
}

th:first-child,
td:first-child {
  min-width: 180px;
  white-space: nowrap;
}

th:last-child,
td:last-child {
  border-right: none;
}

tbody tr {
  border-bottom: 1px solid var(--grid);
}

tbody tr:nth-child(even) {
  background: #fbfbf9;
}

tbody tr:hover {
  background: #f1f7f2;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.col-title {
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.col-title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.col-title.active {
  color: var(--accent);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.icon-btn:hover {
  background: #edf3ee;
}

.icon-btn.active {
  color: var(--accent);
}

.sort-indicator.active {
  font-weight: 700;
}

.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--grid);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 24px rgba(36, 53, 43, 0.12);
  min-width: 180px;
  max-height: 240px;
  overflow: auto;
  z-index: 10;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 2px;
  color: var(--ink);
}

.filter-divider {
  height: 1px;
  background: var(--grid);
  margin: 6px 0;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page {
    padding: 24px 16px 48px;
  }

  .title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-wrap {
    border-radius: 14px;
  }
}
