/* ParkingAreaServer 관리자 공통 스타일 (빌드툴 없음) */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --line: #e2e5ee;
  --text: #1c2030;
  --muted: #6b7280;
  --brand: #3d4db7;
  --brand-soft: #eceffc;
  --danger: #d64545;
  --ok: #17915c;
  --warn: #c98a12;
  --radius: 10px;
}

* { box-sizing: border-box; }

/* hidden 속성은 항상 이긴다.
 * .modal{display:flex} 같은 작성자 규칙은 브라우저 기본 [hidden]{display:none}
 * 보다 우선순위가 높다. 그래서 JS 로 hidden 을 걸어도 요소가 계속 보인다.
 * (실제로 층 복사 모달이 항상 떠서 에디터 조작을 막았다.) */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Pretendard", "맑은 고딕", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--brand); text-decoration: none; }

/* ---------------------------------------------------------------- 헤더 */
header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  height: 52px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
header.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; }
header.topbar .spacer { flex: 1; }
header.topbar .who { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- 레이아웃 */
.wrap { max-width: 1180px; margin: 22px auto; padding: 0 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; margin: 0 0 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------------------------------------------------------- 폼 */
label.field { display: block; margin-bottom: 10px; }
label.field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
input, select, textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-soft);
  border-color: var(--brand);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }

button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
button:hover { background: #f3f4f8; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); border-color: #f0c9c9; }
button.danger:hover { background: #fdf2f2; }
button:disabled { opacity: .5; cursor: default; }
button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- 표 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr.clickable:hover { background: #f8f9fc; cursor: pointer; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--brand-soft);
  color: var(--brand);
}
.badge.gray { background: #eef0f4; color: var(--muted); }
.badge.ok { background: #e4f5ec; color: var(--ok); }
.badge.warn { background: #fdf3e0; color: var(--warn); }
.badge.danger { background: #fdeaea; color: var(--danger); }

/* ---------------------------------------------------------------- 토스트 */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #23273a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  z-index: 999;
  max-width: 80vw;
}
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); }

/* ---------------------------------------------------------------- 로그인 */
.login-box {
  max-width: 320px;
  margin: 12vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
}
.login-box h1 { font-size: 18px; margin: 0 0 4px; }
.login-box p.sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-box button { width: 100%; margin-top: 8px; }
.login-box .err { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

/* ---------------------------------------------------------------- 단지 위치 지도 */
.mapbox { position: relative; height: 380px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
#aptMap { width: 100%; height: 100%; }
.map-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10;
  background: rgba(255,255,255,.92); border-radius: 8px; padding: 6px 12px;
  font-size: 12px; text-align: center; line-height: 1.5; pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.12); white-space: nowrap;
}
.map-gps {
  position: absolute; right: 10px; bottom: 10px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px; padding: 0;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.map-error {
  position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: #fafafa; color: var(--danger); text-align: center; padding: 20px; line-height: 1.6;
}

/* ---------------------------------------------------------------- 이용자 명단 */
.notice { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; background: var(--brand-soft); }
.notice.warn { background: #fdf3e0; color: #7a5208; }
tr.revoked td { color: var(--muted); text-decoration: line-through; }
tr.revoked td:last-child { text-decoration: none; }
