/* LPRWeb 全站樣式：深色頂欄仿桌面版車辨管理平台 */

:root {
  --lpr-dark: #262626;
  --lpr-darker: #1b1b1b;
  --lpr-accent: #e8a33d;
}

html, body {
  height: 100%;
}

/* Vue 接管前隱藏未編譯的 {{ }} 模板（FOUC）。需 !important：Vue 掛載的根元素同時帶
   .page-fill（桌面版 media query 內 display:flex，特異性相同但定義在後），不加會被蓋過。 */
[v-cloak] {
  display: none !important;
}

body {
  background-color: #f0f2f5;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

/* 頂部導覽列 */
.lpr-navbar {
  background-color: var(--lpr-dark);
}

.lpr-navbar .navbar-brand {
  color: var(--lpr-accent);
  font-weight: 700;
}

.lpr-navbar .nav-link {
  color: #e6e6e6;
}

.lpr-navbar .nav-link.active,
.lpr-navbar .nav-link:hover {
  color: var(--lpr-accent);
}

.lpr-navbar .navbar-text {
  color: #cccccc;
}

/* 即時監控攝影機面板 */
.camera-panel {
  position: relative;
  background-color: #000;
  border-radius: .375rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.camera-panel canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.camera-panel .camera-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: .25rem .75rem;
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, .65), transparent);
  z-index: 2;
  font-size: .9rem;
}

.camera-panel .camera-status {
  color: #ffb84d;
}

.camera-panel .no-signal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #bbb;
  z-index: 1;
}

.camera-panel .camera-footer {
  position: absolute;
  bottom: .5rem;
  right: .75rem;
  z-index: 3;
}

.camera-panel .no-signal .icon-circle {
  width: 110px;
  height: 110px;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
}

/* 車牌圖片側欄 */
.plate-sidebar {
  background-color: #d9d9d9;
  border-radius: .375rem;
  min-height: 100%;
}

.plate-sidebar .plate-slot {
  background: #fff;
  aspect-ratio: 4 / 3; /* 固定比例：空白佔位與圖片同尺寸，手機/桌面一致 */
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  overflow: hidden;
}

/* 車牌圖片等比例填滿格子（超出部分裁切，不變形） */
.plate-sidebar .plate-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hero 登入頁 */
.login-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1b1b1b 0%, #3a3a3a 55%, #e8a33d 140%);
}

.login-hero .login-card {
  max-width: 420px;
  width: 100%;
}

/* 資料表格 */
.table-toolbar .btn {
  min-width: 84px;
  white-space: nowrap;
}

.table-fixed-head thead th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
  white-space: nowrap;
}

.table-scroll {
  overflow: auto;
}

/* 頁面填滿（桌面版）：標記 .page-fill 的頁面撐滿視窗高度，
   內部 .flex-fill-scroll 表格區吃掉剩餘空間（用戶資料頁車籍表格） */
@media (min-width: 992px) {
  body:has(.page-fill) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }

  body:has(.page-fill) main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .page-fill {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .page-fill > .card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* 滿高版面內維持自然高度的卡片（如用戶頁頂部的快速新增車牌） */
  .page-fill > .card.card-auto-height {
    flex: 0 0 auto;
  }

  .page-fill > .card > .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* 其餘區塊（工具列、用戶表格、分頁列…）維持自然高度，不被壓縮 */
  .page-fill > .card > .card-body > *:not(.flex-fill-scroll) {
    flex-shrink: 0;
  }

  /* 車籍表格：只吃剩餘空間（basis 0，不以內容高度去擠壓其他區塊） */
  .page-fill .flex-fill-scroll {
    flex: 1 1 0;
    min-height: 200px;
  }
}
