/* 탐진강 수온 관측 — Claude Design 번들(탐진강 수온 관측.dc.html)에서 옮긴 스타일.
   색/치수는 디자인 값을 그대로 쓴다. 빌드 도구 없이 그대로 서빙된다. */

:root {
  --bg: #EEF4F6;
  --ink: #14313B;
  --ink-2: #3C5560;
  --muted: #5C7480;
  --muted-2: #7A8A92;
  --line: #D6E2E7;
  --line-2: #C9D8DE;
  --line-3: #EDF2F4;
  --panel: #fff;
  --navy: #0E3A4A;
  --teal: #1C7C9A;
  --teal-dark: #166A85;

  --ok: #2A8C6A;
  --ok-bg: #E4F3EC;
  --ok-ink: #1F6B50;
  --warn: #B8730A;
  --warn-bg: #FBEED3;
  --danger: #C0392B;
  --danger-bg: #FBE1DE;
  --danger-ink: #A32E22;
  --offline: #5F7079;
  --offline-bg: #E7ECEF;
  --fault: #7B4FB0;
  --fault-bg: #EEE6F7;
}

/* Pretendard 는 CDN 으로 받지 않는다(허용 CDN: Leaflet, Chart.js).
   설치되어 있으면 쓰고, 없으면 시스템 한글 폰트로 떨어진다. */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: #0E5A72; text-decoration: underline; }
input, select, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .55; cursor: default; }
input:focus, select:focus { outline: 2px solid #7FB9CC; outline-offset: 1px; }
table { border-collapse: collapse; width: 100%; }
.leaflet-container { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- 로그인 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #E6F0F4 0%, #EEF4F6 100%);
  padding: 40px;
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 10px 40px rgba(20, 49, 59, .06);
}
.login-org { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.login-title { font-size: 26px; font-weight: 700; color: var(--navy); }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.field input[type="email"],
.field input[type="password"] {
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  color: var(--ink);
  background: #FAFCFD;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--teal); }
.btn-primary {
  height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}
.btn-primary:hover:not([disabled]) { background: var(--teal-dark); }
.msg-err {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}
.msg-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}
.login-note {
  font-size: 13px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.5;
}

/* ---------- 앱 골격 ---------- */
.app { display: flex; min-height: 100vh; }
.nav {
  width: 224px;
  flex: 0 0 224px;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
}
.nav-brand { padding: 0 12px 28px; display: flex; flex-direction: column; gap: 4px; }
.nav-org { font-size: 12px; color: #8FC0D0; letter-spacing: .06em; }
.nav-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: #C7DEE6;
  background: transparent;
}
.nav-btn:hover { background: rgba(255, 255, 255, .10); }
.nav-btn.is-active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.nav-btn.is-active .nav-dot { background: #6FD3EA; }
.nav-badge {
  margin-left: auto;
  background: #C93B3B;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}
.nav-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding-top: 14px;
}
.nav-email {
  padding: 6px 14px 10px;
  font-size: 13px;
  color: #8FC0D0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-sub {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  text-align: left;
  font-size: 15px;
  color: #C7DEE6;
  background: transparent;
}
.nav-sub:hover { background: rgba(255, 255, 255, .10); }
.nav-sub.is-active { background: rgba(255, 255, 255, .14); color: #fff; }

.main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 샘플 데이터 배너 */
.sample-banner {
  background: #FFF6DC;
  border: 1px solid #F1DDA0;
  color: #7A5A08;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
}

.screen { display: flex; flex-direction: column; gap: 28px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-head-col { display: flex; flex-direction: column; gap: 6px; }
h1.page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.01em;
}
.page-sub { font-size: 14px; color: var(--muted); }
.btn-ghost {
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
}
.btn-ghost:hover { background: #F4F8FA; }

/* ---------- 현황 ---------- */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 14px;
  padding: 18px 22px;
  border: 1px solid transparent;
}
.alert-banner.is-clear {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-color: #BFE2D0;
}
.alert-banner.is-open {
  background: var(--danger-bg);
  color: #8E2A1F;
  border-color: #F0C2BC;
}
.alert-dot { width: 12px; height: 12px; border-radius: 50%; }
.alert-banner.is-clear .alert-dot { background: var(--ok); }
.alert-banner.is-open .alert-dot { background: #C93B3B; }
.alert-text { font-size: 18px; font-weight: 600; }
.btn-inherit {
  margin-left: auto;
  height: 36px;
  padding: 0 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
}

.status-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.site-grid {
  flex: 1 1 560px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.site-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--offline);
  border-radius: 14px;
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  min-height: 210px;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.site-card:hover { box-shadow: 0 6px 24px rgba(20, 49, 59, .08); }
.site-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.site-card-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.site-name { font-size: 18px; font-weight: 700; color: var(--ink); word-break: keep-all; }
.site-desc { font-size: 13px; color: var(--muted); }
.pill {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
}
.site-temp { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.site-temp-val {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.site-temp-unit { font-size: 22px; color: var(--muted); }
.site-foot {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.map-panel {
  flex: 1 1 400px;
  max-width: 480px;
  min-width: 320px;
  position: sticky;
  top: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#map { height: 460px; background: #DDE9EE; }
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--muted);
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- 필터 바 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-end; }
.filter-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.filter-col select {
  height: 42px;
  min-width: 200px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}
.seg {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.seg button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid #E2EBEF;
  font-size: 15px;
  color: var(--ink-2);
  background: transparent;
}
.seg button:last-child { border-right: 0; }
.seg button.is-on { background: var(--teal); color: #fff; font-weight: 600; }
.date-row { display: flex; align-items: center; gap: 8px; }
.date-row input[type="date"] {
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
}
.date-sep { color: var(--muted); }
.btn-outline {
  margin-left: auto;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--teal);
  border-radius: 10px;
  background: #fff;
  color: var(--teal);
  font-size: 15px;
  font-weight: 600;
}
.btn-outline:hover { background: #EAF4F7; }

/* ---------- 차트 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.chart-card {
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chart-summary { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.chart-legend {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.lg-line { width: 18px; height: 3px; background: var(--teal); border-radius: 2px; }
.lg-band { width: 18px; height: 10px; background: rgba(28, 124, 154, .2); border-radius: 2px; }
.lg-warn { width: 18px; border-top: 2px dashed #D9910B; }
.lg-danger { width: 18px; border-top: 2px dashed #C93B3B; }
.lg-gap {
  width: 18px;
  height: 10px;
  background: repeating-linear-gradient(135deg, #C9D3D8 0 3px, transparent 3px 7px);
  border-radius: 2px;
}
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { width: 100%; height: 340px; display: block; overflow: visible; }
.chart-tip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--muted-2);
  pointer-events: none;
}

/* ---------- 표 ---------- */
.table-card { overflow: hidden; }
thead tr {
  background: #F4F8FA;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
thead th { padding: 14px 20px; font-weight: 600; }
tbody tr { border-top: 1px solid var(--line-3); font-size: 15px; }
tbody td { padding: 13px 20px; }
.t-time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t-site { color: var(--ink); word-break: keep-all; }
.t-right { text-align: right; }
.t-temp { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tag-fault {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--fault-bg);
  color: var(--fault);
}
.table-empty { padding: 48px; text-align: center; color: var(--muted-2); font-size: 15px; }
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--line-3);
  font-size: 14px;
  color: var(--muted);
}
.pager { display: flex; gap: 8px; }
.pager button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
}
.chip {
  display: inline-block;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.row-open { background: #FFF8F7; }
.open-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  height: 42px;
  padding: 0 14px;
}
.open-toggle input { width: 18px; height: 18px; accent-color: var(--teal); }

/* ---------- 비밀번호 변경 ---------- */
.pw-form {
  width: 420px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pw-form input {
  height: 46px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  color: var(--ink);
}
.pw-form .btn-primary { height: 48px; font-size: 16px; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .nav {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    padding: 16px;
  }
  .nav-list { flex-direction: row; flex-wrap: wrap; }
  .nav-foot { margin-top: 14px; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .nav-email { padding: 0 8px; }
  .main { padding: 24px 16px 48px; }
  .map-panel { position: static; max-width: none; }
}
