/* =========================================================
   공영주차장 통합관제 시스템 - Design Tokens
   컨셉: 관제실(Control Room) - 다수의 주차장을 동시에 감시하고
   이상 신호에 즉시 반응하는 화면. CCTV/관제 소프트웨어의
   다크 UI 어휘를 가져오되, 상태색(초록/주황/빨강)으로
   가동률을 즉각 읽을 수 있게 한다.
   ========================================================= */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* Color */
  --bg-0: #0d1520;         /* 최하단 배경 */
  --bg-1: #121c29;         /* 사이드바/헤더 */
  --surface: #1a2634;      /* 카드 표면 */
  --surface-hover: #21303f;
  --border: #263544;
  --text-primary: #e9eef3;
  --text-secondary: #8fa1b3;
  --text-tertiary: #5c6f82;

  --accent: #3da5d9;       /* 주 강조색 - 관제 블루 */
  --accent-dim: rgba(61, 165, 217, 0.14);

  --status-safe: #46b876;      /* 여유 */
  --status-safe-bg: rgba(70, 184, 118, 0.12);
  --status-busy: #e8a33d;      /* 혼잡 */
  --status-busy-bg: rgba(232, 163, 61, 0.12);
  --status-full: #e4573d;      /* 만차 */
  --status-full-bg: rgba(228, 87, 61, 0.12);

  /* Type */
  --font-display: 'Pretendard', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Pretendard', monospace;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- Layout shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform .25s ease;
}

.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #2477a0);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}

.sidebar__brand-text {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.sidebar__brand-text small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.sidebar__nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__section-label {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 12px 12px 6px;
  letter-spacing: .04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.nav-item__icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item__badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--status-full);
  background: var(--status-full-bg);
  padding: 1px 6px;
  border-radius: 20px;
}

.sidebar__footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--status-safe);
  box-shadow: 0 0 0 3px var(--status-safe-bg);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ---------- Main / Topbar ---------- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: rgba(13, 21, 32, .85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar__menu-btn {
  display: none;
  background: none; border: none; color: var(--text-primary);
  cursor: pointer; padding: 6px;
}

.topbar__search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-tertiary);
}
.topbar__search input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px; width: 100%;
}
.topbar__search input::placeholder { color: var(--text-tertiary); }

.topbar__right { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text-primary); background: var(--surface-hover); }
.icon-btn__dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--status-full);
  border: 1.5px solid var(--bg-1);
}

.profile { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.profile__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3da5d9, #7c5cd1);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.profile__name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.profile__role { font-size: 11px; color: var(--text-tertiary); }

/* ---------- Content ---------- */
.content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-heading h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: -0.3px; }
.page-heading p { margin: 0; font-size: 12.5px; color: var(--text-tertiary); }
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--status-safe);
  background: var(--status-safe-bg);
  padding: 5px 10px; border-radius: 20px;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card--link {
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.stat-card--link:hover {
  border-color: var(--status-busy);
  transform: translateY(-1px);
}
.stat-card__top { display: flex; align-items: center; justify-content: space-between; }
.stat-card__label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.stat-card__icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card__value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.stat-card__value span { font-size: 13px; color: var(--text-tertiary); font-weight: 500; margin-left: 2px; }
.stat-card__delta { font-size: 11.5px; color: var(--text-tertiary); }
.stat-card__delta.up { color: var(--status-safe); }
.stat-card__delta.warn { color: var(--status-full); }

/* Section layout */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.panel__head h2 { font-size: 14.5px; margin: 0; letter-spacing: -0.2px; }
.panel__head a { font-size: 12px; color: var(--accent); font-weight: 500; }

/* Parking lot cards */
.lot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.lot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.lot-card:hover { border-color: var(--accent); transform: translateY(-1px); }

.lot-card__head { display: flex; justify-content: space-between; gap: 10px; }
.lot-card__name { font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.lot-card__addr { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

.badge {
  font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  white-space: nowrap; height: fit-content;
}
.badge.safe { color: var(--status-safe); background: var(--status-safe-bg); }
.badge.busy { color: var(--status-busy); background: var(--status-busy-bg); }
.badge.full { color: var(--status-full); background: var(--status-full-bg); }

.lot-card__body { display: flex; align-items: center; gap: 14px; }

.gauge { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.gauge svg { transform: rotate(-90deg); }
.gauge__track { fill: none; stroke: var(--border); stroke-width: 6; }
.gauge__value { fill: none; stroke-width: 6; stroke-linecap: round; }
.gauge__pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
}

.lot-card__stats { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lot-card__occ { font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.lot-card__occ span { color: var(--text-tertiary); font-size: 12px; font-weight: 500; }
.lot-card__sales { font-size: 11.5px; color: var(--text-secondary); }

.lot-card__foot {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-tertiary);
  padding-top: 10px; border-top: 1px solid var(--border);
}
.cctv-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-safe); }
.cctv-dot.off { background: var(--text-tertiary); }

/* Alerts */
.alert-list { display: flex; flex-direction: column; gap: 2px; }
.alert-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.alert-row:last-child { border-bottom: none; }
.alert-row__icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.alert-row__body { flex: 1; min-width: 0; }
.alert-row__title { font-size: 12.5px; font-weight: 600; }
.alert-row__lot { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; }
.alert-row__time { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

/* Chart panel */
.chart-wrap { position: relative; height: 240px; }

/* ---------- Filter bar (정산/매출 조회 조건) ---------- */
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.filter-row:last-of-type { border-bottom: none; }

.filter-label {
  width: 132px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-sep { color: var(--text-tertiary); font-size: 12.5px; }

.input-month {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 7px 10px;
  color-scheme: dark;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, color .15s ease;
}
.checkbox-pill:has(input:checked) {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-dim);
}
.checkbox-pill--all {
  font-weight: 700;
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.checkbox-pill--all:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.checkbox-pill input {
  accent-color: var(--accent);
  width: 14px; height: 14px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  padding-top: 14px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #2f8fbd; }
.btn--reset { background: var(--surface-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.btn--reset:hover { color: var(--text-primary); }

/* ---------- Data table (정산/매출 결과) ---------- */
.summary-inline { font-size: 12.5px; color: var(--text-secondary); }
.summary-inline strong { color: var(--accent); font-family: var(--font-mono); }

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 720px;
}
.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: center;
}
.data-table thead th {
  background: var(--bg-1);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}
.data-table td.cell-lot {
  text-align: left;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.data-table td.num { font-family: var(--font-mono); color: var(--text-secondary); }
.data-table td.num.strong { color: var(--text-primary); font-weight: 700; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table .empty-row { color: var(--text-tertiary); padding: 28px 12px; }

@media (max-width: 720px) {
  .filter-label { width: 100%; }
}

.input-text {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  width: 100%;
  max-width: 320px;
}
.input-text::placeholder { color: var(--text-tertiary); }

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 20px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  border-radius: 20px;
  transition: width .3s ease;
}

.equip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.equip-row + .equip-row { margin-top: 4px; }

/* ---------- Live monitoring (실시간 관제) ---------- */
.cctv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.cctv-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, #0a1119, #0a1119 10px, #0d1620 10px, #0d1620 20px);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.cctv-tile__badge {
  position: absolute;
  top: 6px; left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cctv-tile__badge.live { background: rgba(228, 87, 61, .16); color: var(--status-full); }
.cctv-tile__badge.offline { background: var(--surface-hover); color: var(--text-tertiary); }
.cctv-tile__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}
.cctv-tile__badge.live .cctv-tile__dot { animation: pulse 1.4s infinite; }
.cctv-tile__label {
  position: absolute;
  bottom: 6px; left: 6px;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.live-meta__item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.live-meta__label { color: var(--text-tertiary); }
.live-meta__value { font-family: var(--font-mono); font-weight: 700; color: var(--text-primary); }

/* ---------- Tabs (정기권 · 할인권 내역) ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 6px;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Responsive ---------- */
.topbar__overlay { display: none; }

@media (max-width: 1200px) {
  /* stat-grid, lot-grid는 auto-fit이라 별도 컬럼수 지정 없이 자동으로 줄어듭니다 */
}

@media (max-width: 992px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .topbar__menu-btn { display: flex; }
  .topbar__search { display: none; }
  .topbar__overlay.open {
    display: block;
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 39;
  }
}

@media (max-width: 720px) {
  .content { padding: 16px; }
  .stat-card__value { font-size: 20px; }
  .profile__name, .profile__role { display: none; }
}

@media (max-width: 480px) {
  .page-heading { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   로그인 화면
   ========================================================================== */

.login-body {
  min-height: 100vh;
  display: flex;
  background: var(--bg-0);
}

.login {
  margin: auto;
  width: 100%;
  max-width: 400px;
  padding: 32px 20px;
}

.login__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.login__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login__mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
}

.login__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.login__subtitle {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  margin: 3px 0 0;
}

.login__error {
  margin: 0 0 18px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--status-full-bg);
  border: 1px solid var(--status-full);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login__label {
  font-size: 12px;
  color: var(--text-secondary);
}

.login__input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
}

.login__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.login__submit {
  margin-top: 6px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #08131c;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login__submit:hover { filter: brightness(1.08); }

.login__note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   주차장 선택
   ========================================================================== */

.lot-picker__form {
  padding: 16px 18px 18px;
}

.lot-picker__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 14px;
  margin-bottom: 16px;
}

.lot-picker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.lot-picker__item:hover { background: var(--surface-hover); }

.lot-picker__item input { accent-color: var(--accent); flex: 0 0 auto; }

.lot-picker__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lot-picker__submit {
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #08131c;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lot-picker__submit:hover { filter: brightness(1.08); }

.lot-picker__empty {
  margin: 0;
  padding: 22px 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

/* ==========================================================================
   주차장별 현황 표
   ========================================================================== */

.table-wrap { overflow-x: auto; }

.lot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.lot-table th,
.lot-table td {
  padding: 11px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lot-table th {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-1);
}

.lot-table td { color: var(--text-primary); }

.lot-table tbody tr:hover { background: var(--surface-hover); }

.lot-table tbody tr:last-child td { border-bottom: none; }

.lot-table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.lot-table .strong { font-weight: 600; color: var(--status-busy); }

.lot-table .dim { color: var(--text-tertiary); }

.table-note {
  margin: 0;
  padding: 13px 18px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   로그아웃 버튼 (헤더)
   ========================================================================== */

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}

.logout-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--status-full);
}

/* 좁은 화면에서는 아이콘만 */
@media (max-width: 768px) {
  .logout-btn span { display: none; }
  .logout-btn { padding: 7px 9px; }
}

/* ==========================================================================
   조회 옵션 (접히는 패널)
   ========================================================================== */

.opts { padding: 0; }

.opts__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: var(--text-primary);
  font-size: 13.5px;
}

/* 기본 삼각형 마커 제거 */
.opts__summary::-webkit-details-marker { display: none; }
.opts__summary::marker { content: ''; }

.opts__summary:hover { background: var(--surface-hover); }

.opts__title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  white-space: nowrap;
}

.opts__current {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opts__chevron {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  transition: transform 0.15s ease;
}

.opts[open] .opts__chevron { transform: rotate(180deg); }
.opts[open] .opts__summary { border-bottom: 1px solid var(--border); }

.opts__row {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.opts__label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.opts__field { display: block; max-width: 220px; }

.opts__select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 13.5px;
}

.opts__select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.opts__hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-tertiary);
}

.opts__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}

.opts__reset {
  color: var(--text-secondary);
  font-size: 12.5px;
  text-decoration: none;
}

.opts__reset:hover { color: var(--accent); }

/* 옵션 패널 안에서는 폼 자체 여백을 쓰지 않는다 */
.opts .lot-picker__form { padding: 0; }
.opts .lot-picker__list { margin-bottom: 0; }

/* ==========================================================================
   실시간 관제 — 현장 카드 + 현장별 로그
   ========================================================================== */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.live-site {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* 현장 (헤더) */
.live-site__head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}

.live-site__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-site__stats {
  display: flex;
  gap: 18px;
}

.live-stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.live-stat__label {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.live-stat__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--text-primary);
}

.live-stat__value.strong { color: var(--status-busy); font-weight: 600; }

/* 현장 아래의 입·출차 로그 */
.live-log {
  flex: 1 1 auto;
  max-height: 340px;
  overflow-y: auto;
}

.live-log__row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.live-log__row:last-child { border-bottom: none; }

.live-dir {
  display: inline-block;
  padding: 2px 0;
  border-radius: 3px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
}

.live-dir.in {
  background: var(--accent-dim);
  color: var(--accent);
}

.live-dir.out {
  background: var(--status-safe-bg);
  color: var(--status-safe);
}

.live-log__plate {
  font-family: var(--font-mono);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-log__time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.live-log__time em {
  margin-left: 4px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-tertiary);
}

.live-log__fee {
  min-width: 56px;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}

.live-log__empty {
  margin: 0;
  padding: 26px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.live-site__foot {
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  font-size: 11.5px;
  color: var(--text-tertiary);
}
