:root {
  --bg: #f3f6fb;
  --ink: #10243f;
  --muted: #5f718a;
  --line: #d8e2ee;
  --panel: #ffffff;
  --accent: #0b4f8f;
  --accent-2: #1f7acb;
  --danger: #b73535;
  --ok: #21865a;
  --shadow: 0 18px 45px rgba(16, 36, 63, .12);
}

/* Legacy-position copy retained only to keep this large stylesheet stable. */
@media (max-width: 0px) {
/* 2026 sci-fi security login refresh */
.login-view {
  grid-template-rows: 64px minmax(560px, 1fr) 48px;
  background: #030b16;
  color: #eaf7ff;
}

.login-topbar {
  position: relative;
  z-index: 10;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(79, 215, 255, .28);
  background: linear-gradient(90deg, #06111f 0%, #0a1c2e 52%, #06111f 100%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .28);
}

.login-topbar-title {
  color: #f4fbff;
  font-size: 23px;
  letter-spacing: .08em;
  text-shadow: 0 0 18px rgba(69, 205, 255, .42);
}

.login-stage {
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: center;
  gap: 42px;
  min-height: 560px;
  padding: 54px clamp(32px, 5vw, 96px);
  background-color: #061321;
  background-image:
    linear-gradient(90deg, rgba(2, 9, 18, .04) 0%, rgba(2, 9, 18, .02) 47%, rgba(2, 9, 18, .38) 72%, rgba(2, 9, 18, .78) 100%),
    url("assets/login/sci-fi-security-hero.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.login-stage::before {
  inset: 0;
  height: auto;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(39, 196, 255, .08), transparent 18%, transparent 82%, rgba(0, 11, 24, .74)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(84, 218, 255, .025) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(84, 218, 255, .02) 80px);
  pointer-events: none;
}

.login-stage::after {
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: 2px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, #38cfff 24%, #79f2ff 50%, #38cfff 76%, transparent);
  box-shadow: 0 0 18px rgba(56, 207, 255, .75);
  opacity: .75;
}

.login-stage .brand-panel {
  min-height: 470px;
  padding: 0;
  visibility: hidden;
}

.login-illustration,
.login-stage .brand-copy {
  display: none;
}

.login-stage .login-card {
  align-self: center;
  width: 350px;
  padding: 0 24px 32px;
  border: 1px solid rgba(78, 211, 255, .38);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(7, 25, 43, .94), rgba(2, 11, 22, .88));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, .48),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 0 34px rgba(21, 157, 220, .12);
  backdrop-filter: blur(18px);
}

.login-stage .login-card::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 38px;
  left: 38px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #61ddff, transparent);
  box-shadow: 0 0 14px #29c8ff;
}

.login-stage .login-card h2 {
  min-height: 82px;
  margin: 0 -24px 26px;
  border-bottom: 1px solid rgba(108, 218, 255, .22);
  color: #f4fbff;
  font-size: 25px;
  letter-spacing: .16em;
  text-shadow: 0 0 16px rgba(80, 213, 255, .35);
}

.login-stage .login-card label {
  gap: 9px;
  margin-bottom: 18px;
  color: #c9e7f4;
  font-weight: 600 !important;
  letter-spacing: .04em;
}

.login-stage .login-card input,
.login-stage .login-card select {
  min-height: 42px;
  border: 1px solid rgba(101, 201, 238, .38);
  border-radius: 6px;
  background: rgba(3, 14, 27, .78);
  color: #ffffff;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, .42);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.login-stage .login-card input:focus,
.login-stage .login-card select:focus {
  border-color: #55d9ff;
  box-shadow: 0 0 0 3px rgba(70, 208, 255, .14), 0 0 18px rgba(58, 201, 255, .12);
}

.login-links {
  margin: 12px 2px 22px;
}

.login-links a,
.login-footer a {
  color: #55d9ff;
}

.login-stage .login-card button[type="submit"] {
  min-height: 44px;
  border: 1px solid rgba(124, 232, 255, .45);
  border-radius: 6px;
  background: linear-gradient(90deg, #087cab, #12a8d5 55%, #087cab);
  box-shadow: 0 10px 24px rgba(0, 128, 178, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
  font-size: 15px;
  letter-spacing: .12em;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}

.login-stage .login-card button[type="submit"]:hover {
  filter: brightness(1.12);
  box-shadow: 0 12px 30px rgba(0, 172, 225, .34), 0 0 18px rgba(58, 208, 255, .18);
  transform: translateY(-1px);
}

.login-footer {
  min-height: 48px;
  align-items: center;
  padding: 0 28px;
  border-top: 1px solid rgba(79, 215, 255, .16);
  background: #030b16;
  color: #7f9bad;
  font-family: "Microsoft JhengHei", "Segoe UI", sans-serif;
}

@media (max-width: 1180px) {
  .login-stage {
    grid-template-columns: 1fr 330px;
    padding: 42px 30px;
    background-position: 36% center;
  }

  .login-stage .login-card {
    width: 330px;
  }
}

@media (max-width: 680px) {
  .login-view {
    grid-template-rows: 56px minmax(650px, 1fr) auto;
  }

  .login-topbar {
    height: 56px;
    padding: 0 16px;
  }

  .login-topbar-title {
    font-size: 18px;
  }

  .login-stage {
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
    padding: 210px 16px 38px;
    background-image:
      linear-gradient(180deg, rgba(2, 9, 18, .02) 0%, rgba(2, 9, 18, .18) 34%, rgba(2, 9, 18, .92) 67%, #020914 100%),
      url("assets/login/sci-fi-security-hero.png");
    background-position: 27% center;
  }

  .login-stage .brand-panel {
    display: none;
  }

  .login-stage .login-card {
    justify-self: center;
    width: min(350px, calc(100vw - 32px));
    margin-top: 0;
  }

  .login-footer {
    min-height: 52px;
    padding: 12px 16px;
  }
}

/* Final override: keep the planner rule row compact and vertically aligned. */
body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar {
  align-items: center !important;
  min-height: 23px !important;
  height: 23px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 20px !important;
  min-height: 20px !important;
  line-height: 20px !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title {
  position: relative !important;
  top: -2px !important;
  transform: none !important;
  padding: 0 !important;
  color: #33475a !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar input {
  height: 18px !important;
  min-height: 18px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 18px !important;
}

/* Final planner rule row alignment: use the same row style as the toolbar above. */
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar {
  flex: 0 0 calc(100% + 16px) !important;
  width: calc(100% + 16px) !important;
  min-height: 31px !important;
  height: 31px !important;
  margin: -4px -8px 0 !important;
  padding: 4px 8px !important;
  display: flex !important;
  align-items: center !important;
  align-content: center !important;
  gap: 8px !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #ffffff, #eef2f5) !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 23px !important;
  min-height: 23px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #33475a !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 23px !important;
  white-space: nowrap !important;
  position: static !important;
  top: auto !important;
  transform: none !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar input {
  height: 23px !important;
  min-height: 23px !important;
  padding: 2px 6px !important;
  line-height: normal !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}

/* Final override: make the planner rule row use the same toolbar-row rhythm. */
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar {
  flex: 0 0 calc(100% + 16px) !important;
  width: calc(100% + 16px) !important;
  min-height: 31px !important;
  height: 31px !important;
  margin: -4px -8px 0 !important;
  padding: 4px 8px !important;
  display: flex !important;
  align-items: center !important;
  align-content: center !important;
  gap: 8px !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #ffffff, #eef2f5) !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 23px !important;
  min-height: 23px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #33475a !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 23px !important;
  white-space: nowrap !important;
  position: static !important;
  top: auto !important;
  transform: none !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar input {
  height: 23px !important;
  min-height: 23px !important;
  padding: 2px 6px !important;
  line-height: normal !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar {
  align-items: center !important;
  min-height: 23px !important;
  height: 23px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 20px !important;
  min-height: 20px !important;
  line-height: 20px !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title {
  position: relative !important;
  top: -2px !important;
  transform: none !important;
  padding: 0 !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar input {
  height: 18px !important;
  min-height: 18px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 18px !important;
}

/* 整鈔中心欄寬：各頁依資料內容配置，避免共用站點表格欄寬造成遮蓋。 */
body:not(.guard-mobile-mode) .cashroom-name-table th,
body:not(.guard-mobile-mode) .cashroom-name-table td {
  padding-right: 6px !important;
  padding-left: 6px !important;
}

body:not(.guard-mobile-mode) .cashroom-name-table th:first-child,
body:not(.guard-mobile-mode) .cashroom-name-table td:first-child {
  width: 4% !important;
  text-align: center !important;
}

body:not(.guard-mobile-mode) .cashroom-name-table td {
  text-align: left !important;
}

body:not(.guard-mobile-mode) .cashroom-name-table td .tag,
body:not(.guard-mobile-mode) .cashroom-name-table td button {
  max-width: 100%;
}

/* 現金袋接收：項目、袋號、封條、站點、帳額、清點、保管、狀態、操作 */
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(2) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(3) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(4) { width: 18% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(5) { width: 10% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(6) { width: 10% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(7) { width: 12% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(8) { width: 8% !important; text-align: center !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(9) { width: 8% !important; text-align: center !important; }

/* 分幣清點 */
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(2) { width: 16% !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(3) { width: 20% !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(4) { width: 14% !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(6) { width: 12% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(7) { width: 10% !important; text-align: center !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(8) { width: 12% !important; text-align: center !important; }

/* 補幣零用金庫存 */
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(2) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(3) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(4) { width: 8% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(5) { width: 9% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(6) { width: 11% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(7) { width: 14% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(8) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(9) { width: 19% !important; }

/* 補幣零用金出入庫紀錄 */
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(2) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(3) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(4) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(5) { width: 12% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(6) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(7),
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(8) { width: 7% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(9) { width: 10% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(10) { width: 10% !important; }

/* 差異處理 */
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(2) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(3) { width: 17% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(4) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(6) { width: 11% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(7) { width: 10% !important; text-align: center !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(8) { width: 11% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(9) { width: 8% !important; text-align: center !important; }

/* 整鈔報表 */
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(2) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(3) { width: 14% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(4) { width: 18% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(6),
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(7) { width: 10% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(8) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(9) { width: 11% !important; }

.login-music-prompt {
  position: fixed;
  right: 28px;
  bottom: 72px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid rgba(52, 211, 255, .58);
  border-radius: 999px;
  color: #dff8ff;
  background: rgba(2, 19, 34, .84);
  box-shadow: 0 0 22px rgba(24, 181, 232, .22);
  backdrop-filter: blur(10px);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  animation: login-music-pulse 1.8s ease-in-out infinite;
}

.login-music-prompt[hidden] {
  display: none;
}

.login-music-prompt span {
  color: #39d7ff;
  font-size: 20px;
  line-height: 1;
}

.login-music-prompt:hover,
.login-music-prompt:focus-visible {
  border-color: #67e4ff;
  background: rgba(3, 36, 58, .94);
  outline: none;
}

@keyframes login-music-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(24, 181, 232, .16); }
  50% { box-shadow: 0 0 28px rgba(24, 181, 232, .34); }
}

@media (max-width: 680px) {
  .login-music-prompt {
    right: 16px;
    bottom: 62px;
  }
}

/* Keep the full helmet in frame on wide login screens. */
@media (min-width: 681px) {
  .login-stage {
    background-position: center, left center;
    background-size: 100% 100%, auto 105%;
  }
}
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 420px;
  min-height: 100vh;
}

.brand-panel {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 8vw;
  background:
    linear-gradient(135deg, rgba(11, 47, 91, .95), rgba(7, 22, 43, .96)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255,255,255,.08) 42px 43px);
  color: #fff;
}

.brand-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
}

.brand-panel p {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 18px;
  line-height: 1.8;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 112px;
  height: 76px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.66);
  border-radius: 8px;
  background: #ffffff;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logo.small {
  width: 82px;
  height: 60px;
  border: 0;
  background: transparent;
}

.login-card {
  align-self: center;
  margin: 32px;
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 26px;
  font-size: 25px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(.96);
}

.hint {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.dashboard-view {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  background: linear-gradient(180deg, #071b34 0%, #0b2f5b 100%);
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 86px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: #2f3742;
  text-align: center;
}

.sidebar-brand > div:last-child {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.sidebar-brand strong {
  color: #2f3742;
  font-size: 17px;
  line-height: 1.2;
}

.sidebar-brand span {
  display: block;
  margin-top: 0;
  color: #4b5563;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.nav-button,
.ghost-button {
  width: 100%;
  background: transparent;
  color: rgba(255,255,255,.76);
  text-align: left;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(31, 122, 203, .28);
  color: #fff;
}

.ghost-button {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.22);
  flex: 0 0 auto;
  background: rgba(255,255,255,.08);
}

.workspace {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar p,
.topbar h2 {
  margin: 0;
}

.topbar p {
  color: var(--muted);
  font-weight: 700;
}

.topbar h2 {
  margin-top: 6px;
  font-size: 30px;
}

.status-stack {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.status-stack strong {
  color: var(--ink);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
}

.content-grid:has(.site-table) {
  grid-template-columns: minmax(0, 1fr);
}

.content-grid:has(.planner-table) {
  grid-template-columns: minmax(0, 1fr);
}

.content-grid:has(.approval-table) {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  overflow: hidden;
}

.panel:has(.table-actions),
.panel:has(.permission-manager),
.panel:has(.table) {
  overflow-x: auto;
}

.panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel h3 {
  margin: 0;
  font-size: 18px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th:last-child,
.table td:last-child {
  min-width: 210px;
}

.table th {
  color: var(--muted);
  font-size: 13px;
}

.audit-table {
  table-layout: fixed;
  min-width: 900px;
}

.audit-table th,
.audit-table td {
  white-space: nowrap;
  vertical-align: middle;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 150px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  width: 72px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 110px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
  width: 130px;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
  width: 150px;
}

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
  width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-table th:nth-child(7),
.audit-table td:nth-child(7) {
  width: 120px;
}

.reconcile-table {
  min-width: 880px;
}

.reconcile-table th:nth-child(6),
.reconcile-table td:nth-child(6) {
  min-width: 110px;
}

.reconcile-table th:last-child,
.reconcile-table td:last-child {
  width: 96px;
  min-width: 96px;
}

.site-table {
  table-layout: fixed;
  min-width: 1120px;
}

.site-table th,
.site-table td {
  padding: 2px 18px;
  white-space: nowrap;
  vertical-align: middle;
}

.site-table th:nth-child(1),
.site-table td:nth-child(1) {
  width: 90px;
}

.site-table th:nth-child(2),
.site-table td:nth-child(2) {
  width: 90px;
}

.site-table th:nth-child(3),
.site-table td:nth-child(3) {
  width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-table th:nth-child(4),
.site-table td:nth-child(4) {
  width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-table th:nth-child(5),
.site-table td:nth-child(5) {
  width: 70px;
}

.site-table th:nth-child(6),
.site-table td:nth-child(6) {
  width: 100px;
}

.site-table th:nth-child(7),
.site-table td:nth-child(7) {
  width: 100px;
}

.site-table th:nth-child(8),
.site-table td:nth-child(8) {
  width: 100px;
}

.site-table tbody tr[data-site-row] {
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.site-table tbody tr[data-site-row]:hover td,
.site-table tbody tr[data-site-row]:focus-visible td {
  background: #eef6ff;
  box-shadow: inset 0 1px 0 rgba(15, 88, 150, 0.12), inset 0 -1px 0 rgba(15, 88, 150, 0.12);
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.row-actions button {
  min-height: 28px;
  padding: 2px 8px;
}

.danger-text {
  color: var(--danger);
  border-color: rgba(196, 77, 77, 0.25);
  background: rgba(196, 77, 77, 0.08);
}

.site-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 16px 0;
}

.site-tools .search-input {
  flex: 1 1 280px;
}

.site-tools select {
  width: auto;
  min-width: 150px;
}

.site-browser {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.site-tree-panel,
.site-name-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.site-browser-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.site-tree-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.site-tree-panel {
  border-right: 0;
}

.site-tree-panel header,
.site-name-panel header,
.planner-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fcfe, #edf4f8);
}

.site-pane-toolbar,
.site-grid-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #eef2f5);
}

.site-pane-toolbar button,
.site-grid-toolbar button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5a8a2b;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
}

.site-pane-toolbar button:hover,
.site-pane-toolbar button:focus-visible {
  background: #eaf3f9;
  outline: 1px solid #9fc4df;
}

.site-pane-toolbar .tool-add::before {
  content: "\271a";
  color: #49a84f;
}

.site-pane-toolbar .tool-edit::before {
  content: "\270e";
  color: #428bc1;
}

.site-pane-toolbar .tool-delete::before {
  content: "\2716";
  color: #d85b4f;
}

.site-pane-toolbar .tool-sort::before {
  content: "\21f5";
  color: #7ca26d;
}

.site-tree-search,
.site-grid-toolbar {
  border-bottom: 1px solid var(--line);
}

.site-tree-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  position: relative;
  padding: 4px 8px;
  background: #fbfcfd;
}

.site-tree-search input,
.site-grid-toolbar input,
.site-grid-toolbar select {
  height: 23px;
  min-height: 23px;
  padding: 2px 6px;
  border: 1px solid #cdd7df;
  border-radius: 3px;
  background: #ffffff;
  color: #7a8793;
  font-size: 12px;
  font-weight: 400;
}

.site-tree-search input {
  width: 100%;
  min-width: 0;
  padding-right: 26px;
}

.search-magnifier {
  display: inline-block;
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 1px solid #5d96bb;
  border-radius: 50%;
  pointer-events: none;
}

.search-magnifier::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 6px;
  height: 1px;
  background: #5d96bb;
  transform: rotate(45deg);
  transform-origin: left center;
}

.site-tree-search .search-magnifier {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
}

.site-grid-toolbar {
  justify-content: flex-start;
}

.site-grid-actions,
.site-grid-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.site-grid-actions {
  flex: 1 1 auto;
  overflow: hidden;
}

.site-grid-filter {
  flex: 0 0 auto;
  margin-left: auto;
}

.site-grid-toolbar .site-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  height: 23px;
  min-width: 0;
  min-height: 23px;
  padding: 1px 3px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #33475a !important;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.site-grid-toolbar .site-tool-button:hover,
.site-grid-toolbar .site-tool-button:focus-visible {
  border: 1px solid #9fc4df;
  background: linear-gradient(180deg, #ffffff, #e4edf4);
  outline: 0;
}

.site-grid-toolbar .site-tool-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 15px;
  line-height: 1;
}

.site-grid-toolbar .site-tool-icon.add,
.site-grid-toolbar .site-tool-icon.import,
.site-grid-toolbar .site-tool-icon.refresh {
  color: #22a24a;
}

.site-grid-toolbar .site-tool-icon.device,
.site-grid-toolbar .site-tool-icon.swap,
.site-grid-toolbar .site-tool-icon.group,
.site-grid-toolbar .site-tool-icon.excel {
  color: #5e9ac9;
}

.site-grid-toolbar .site-tool-icon.manual {
  color: #7c8a96;
}

.site-grid-toolbar .aps-manual-toggle.active {
  border-color: #8fb7d4;
  background: linear-gradient(180deg, #ffffff, #dfeaf2);
  color: #0b6f9e !important;
}

.site-grid-toolbar .site-tool-icon.system {
  color: #d7a32f;
}

.site-grid-toolbar .site-tool-icon.edit {
  color: #4089c9;
}

.site-grid-toolbar .site-tool-icon.stop {
  color: #9aa3aa;
}

.site-grid-toolbar .site-tool-icon.restore {
  color: #c58a2c;
}

.site-grid-toolbar .site-tool-icon.delete {
  color: #df5048;
}

.site-grid-toolbar .site-tool-icon.pdf {
  color: #8a5b4c;
}

.site-grid-toolbar .site-tool-icon.map {
  color: #20825f;
}

.site-grid-toolbar .site-tool-icon.optimize {
  color: #7b6b28;
}

.site-grid-toolbar button {
  color: #4fa34e;
}

.site-grid-toolbar button:nth-child(2) {
  color: #d85145;
}

.site-grid-toolbar button:nth-child(3),
.site-grid-toolbar button:nth-child(4) {
  color: #5ea55c;
}

.site-grid-toolbar select {
  width: 56px;
  margin-left: 0;
}

.site-grid-toolbar input {
  width: 210px;
}

.site-grid-toolbar .vehicle-grid-filter select {
  width: 132px;
}

.site-grid-toolbar .aps-grid-filter select {
  width: 132px;
}

.aps-name-panel {
  position: relative;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.aps-manual-strip {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 156px;
  min-height: 0;
  border-top: 1px solid #c8d5df;
  background: #f7fafc;
  box-shadow: 0 -3px 8px rgba(40, 70, 95, .16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% + 1px));
  transition:
    transform .32s cubic-bezier(.22,.61,.36,1),
    opacity .2s ease;
  will-change: transform;
}

.aps-manual-strip.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.aps-manual-strip header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 5px 8px;
  border-bottom: 1px solid #dbe4ec;
  background: linear-gradient(180deg, #ffffff, #eef3f7);
}

.aps-manual-strip header strong,
.aps-manual-strip header span {
  color: #33475a;
  font-size: 13px;
  font-weight: 400;
}

.aps-manual-strip header span {
  color: #71808d;
}

.aps-manual-thumbs {
  display: flex;
  gap: 7px;
  min-height: 0;
  padding: 7px 8px;
  overflow-x: auto;
  overflow-y: hidden;
}

.aps-manual-thumb {
  position: relative;
  flex: 0 0 142px;
  height: 96px;
  padding: 0;
  border: 1px solid #c6d3df;
  border-radius: 0;
  background: #ffffff;
  overflow: hidden;
}

.aps-manual-thumb:hover {
  border-color: #2ea7d8;
  box-shadow: inset 0 0 0 1px #2ea7d8;
}

.aps-manual-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aps-manual-thumb span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 20px;
  padding: 1px 5px;
  background: rgba(17, 111, 174, .9);
  color: #ffffff;
  font-size: 11px;
  text-align: center;
}

.aps-manual-modal.hidden {
  display: none;
}

.aps-manual-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 28px;
}

.aps-manual-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 38, .62);
}

.aps-manual-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 56px));
  height: min(760px, calc(100vh - 56px));
  border: 1px solid #9eb4c7;
  background: #f7fafc;
  box-shadow: 0 16px 38px rgba(0,0,0,.28);
}

.aps-manual-dialog header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 8px;
  border-bottom: 1px solid #c9d6e1;
  background: linear-gradient(180deg, #ffffff, #edf3f7);
}

.aps-manual-dialog header strong,
.aps-manual-dialog header span {
  color: #33475a;
  font-size: 13px;
  font-weight: 400;
}

.aps-manual-dialog header span {
  margin-left: auto;
  color: #6b7a86;
}

.aps-manual-dialog button {
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #b7c6d2;
  border-radius: 0;
  background: #ffffff;
  color: #33475a;
}

.aps-manual-dialog button:hover {
  border-color: #2ea7d8;
  color: #0b75ad;
}

.aps-manual-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  background: #dfe6ec;
}

.aps-manual-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(0,0,0,.18);
}

.planner-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: min(960px, 72vw);
  margin-left: auto;
}

.planner-panel-actions .site-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 23px;
  min-height: 23px;
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #33475a !important;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.planner-panel-actions .site-tool-button:hover,
.planner-panel-actions .site-tool-button:focus-visible {
  border-color: #9db8d0;
  background: #edf5fb;
}
.planner-grid-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  min-width: 0;
}

.planner-header-meta {
  display: flex;
  flex: 0 1 720px;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 260px;
  margin-left: auto;
  text-align: right;
}

.planner-record-count {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.planner-version-status {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 10px;
  max-width: 100%;
}

.planner-version-status span {
  max-width: min(680px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-grid-toolbar {
  flex-wrap: wrap;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar {
  align-items: center !important;
  min-height: 23px !important;
  height: 23px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 20px !important;
  min-height: 20px !important;
  line-height: 20px !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar input {
  height: 18px !important;
  min-height: 18px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 18px !important;
}

.planner-grid-actions {
  flex-wrap: wrap;
}

.planner-toolbar-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  margin: 0;
  color: #33475a;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.site-grid-toolbar .planner-toolbar-field select,
.site-grid-toolbar .planner-toolbar-field input {
  width: auto;
  height: 23px;
  min-height: 23px;
  color: #33475a;
}

.site-grid-toolbar .planner-city-select {
  width: 88px;
}

.planner-scope-checklist {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  max-width: min(520px, 48vw);
  line-height: 1;
}

.planner-toolbar-field:has(.planner-scope-checklist) {
  height: auto;
  min-height: 23px;
  align-items: flex-start;
  padding-top: 1px;
}

.planner-scope-option {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 21px;
  margin: 0;
  padding: 0 4px;
  border: 1px solid #c8d7e6;
  background: #f8fbfe;
  color: #0b2f5b;
  font-size: 12px;
  line-height: 1;
}

.planner-scope-option input {
  width: 13px;
  height: 13px;
  min-height: 13px;
  margin: 0;
}

.planner-scope-all {
  background: #eef6ff;
  font-weight: 600;
}

.site-grid-toolbar .planner-month-input {
  width: 122px;
}

.planner-vehicle-field {
  gap: 2px;
}

.site-grid-toolbar .planner-vehicle-input {
  width: 42px;
  min-width: 42px;
  padding-inline: 4px;
  text-align: center;
}

.planner-rule-bar {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  gap: 2px 8px;
  margin: -4px -8px 0;
  padding: 0 8px;
  border-top: 1px solid #d7e3ee;
  border-bottom: 1px solid #d7e3ee;
  background: #f7fbff;
  min-height: 24px;
  line-height: 1;
}

.planner-rule-title {
  display: inline-flex;
  align-items: center;
  height: 20px;
  color: #33475a;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
}

.planner-rule-bar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  color: #33475a;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.planner-rule-bar input {
  width: 62px;
  min-height: 18px !important;
  height: 18px;
  padding: 0 4px !important;
  text-align: center;
  line-height: 18px;
}


.planner-grid-filter {
  min-width: 180px;
  overflow: hidden;
}

.planner-grid-filter span,
.planner-grid-toolbar .planner-admin-note {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.planner-grid-filter span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-tree-panel header span,
.site-name-panel header span,
.planner-grid-header span {
  color: var(--muted);
  font-size: 13px;
}

.site-tree-panel header strong,
.site-name-panel header strong,
.site-name-panel header em,
.planner-grid-header strong,
.planner-grid-header em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
}

.site-tree {
  min-height: 0;
  overflow: auto;
  padding: 5px;
}

.site-tree-group {
  display: grid;
}

.site-tree-root,
.site-tree-city,
.site-tree-district {
  display: grid;
  grid-template-columns: 16px 14px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 24px;
  padding: 3px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2f4050;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.site-tree-root span,
.site-tree-city span,
.site-tree-district span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-tree-root em,
.site-tree-city em,
.site-tree-district em {
  color: #758595;
  font-size: 11px;
  font-style: normal;
}

.site-tree-root::before,
.site-tree-city::before,
.site-tree-district::before {
  content: "\25a3";
  color: #d49a20;
  font-size: 13px;
}

.site-tree-district {
  padding-left: 20px;
}

.site-tree-district::before {
  content: "\25a4";
  color: #b8a15a;
  font-size: 12px;
}

.site-tree-root::before {
  content: "\25a3";
  color: #d7a52e;
}

.site-tree-toggle,
.site-tree-branch {
  color: #63788b;
  font-size: 11px;
}

.site-tree-root:hover,
.site-tree-city:hover,
.site-tree-district:hover,
.site-tree-root.active,
.site-tree-city.active,
.site-tree-district.active {
  background: #2ea7d8;
  color: #ffffff;
}

.site-tree-root:hover em,
.site-tree-city:hover em,
.site-tree-district:hover em,
.site-tree-root.active em,
.site-tree-city.active em,
.site-tree-district.active em,
.site-tree-root:hover .site-tree-toggle,
.site-tree-city:hover .site-tree-toggle,
.site-tree-district:hover .site-tree-branch,
.site-tree-root.active .site-tree-toggle,
.site-tree-city.active .site-tree-toggle,
.site-tree-district.active .site-tree-branch,
.site-tree-root:hover::before,
.site-tree-city:hover::before,
.site-tree-district:hover::before,
.site-tree-root.active::before,
.site-tree-city.active::before,
.site-tree-district.active::before {
  color: #ffffff;
}

.site-tree-empty {
  padding: 16px 8px;
  color: var(--muted);
  font-size: 13px;
}

.site-name-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.site-name-panel header > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-name-panel header > div > strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

.site-aps-total {
  color: #33475a;
  white-space: nowrap;
}

.site-grid-wrap {
  min-height: 0;
  overflow: auto;
}

.planner-table-wrap {
  min-height: 0;
  overflow: auto;
}

.site-name-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.site-name-table th,
.site-name-table td {
  height: 28px;
  padding: 4px 8px;
  border-right: 1px solid #e1e7ed;
  border-bottom: 1px solid #e1e7ed;
  color: #33475a;
  font-size: 13px;
  font-weight: 400;
  vertical-align: middle;
}

.site-name-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #ffffff, #f1f4f6);
  color: #2f4050;
  text-align: center;
}

.site-sort-header {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.site-sort-header:hover,
.site-sort-header.active {
  color: #0f5f99;
  font-weight: 700;
}

.site-name-table th:first-child,
.site-name-table td:first-child {
  width: 46px;
  text-align: center;
}

.site-name-table th:nth-child(2),
.site-name-table td:nth-child(2) {
  width: 32px;
  text-align: center;
}

.site-name-table th:nth-child(3),
.site-name-table td:nth-child(3) {
  width: var(--site-col-code, 76px);
  text-align: center;
}

.site-name-table th:nth-child(4),
.site-name-table td:nth-child(4) {
  width: var(--site-col-company, 58px);
  text-align: center;
}

.site-name-table th:nth-child(5),
.site-name-table td:nth-child(5) {
  width: var(--site-col-name, 220px);
}

.site-name-table th:nth-child(6),
.site-name-table td:nth-child(6) {
  width: var(--site-col-city, 60px);
  text-align: center;
}

.site-name-table th:nth-child(7),
.site-name-table td:nth-child(7) {
  width: var(--site-col-district, 60px);
  text-align: center;
}

.site-name-table th:nth-child(8),
.site-name-table td:nth-child(8) {
  width: var(--site-col-address, auto);
  min-width: 260px;
}

.site-name-table th:nth-child(9),
.site-name-table td:nth-child(9) {
  width: var(--site-col-aps, 54px);
  text-align: center;
}

.site-name-table th:nth-child(11),
.site-name-table td:nth-child(11) {
  width: var(--site-col-status, 54px);
  text-align: center;
}

.site-name-table th:nth-child(10),
.site-name-table td:nth-child(10) {
  width: var(--site-col-cycle, 92px);
  min-width: var(--site-col-cycle, 92px);
  text-align: center;
}

.site-resizable-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
}

.site-column-resizer {
  position: absolute;
  top: -4px;
  right: 0;
  bottom: -4px;
  width: 12px;
  cursor: col-resize;
  z-index: 4;
  touch-action: none;
}

.site-column-resizer::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
  width: 1px;
  background: transparent;
}

.site-column-resizer:hover::after,
.site-column-resizer.is-resizing::after {
  background: #0f7db8;
}

body.site-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.vehicle-name-table {
  min-width: 1280px;
}

.vehicle-name-table th:nth-child(5),
.vehicle-name-table th:nth-child(9),
.vehicle-name-table .vehicle-hidden-parking,
.vehicle-name-table .vehicle-hidden-gps {
  display: none;
}

.branch-name-table {
  table-layout: fixed;
}

.branch-name-table .branch-col-index {
  width: 42px;
}

.branch-name-table .branch-col-check {
  width: 34px;
}

.branch-name-table .branch-col-code {
  width: 72px;
}

.branch-name-table .branch-col-name {
  width: 86px;
}

.branch-name-table .branch-col-type {
  width: 54px;
}

.branch-name-table .branch-col-city {
  width: 62px;
}

.branch-name-table .branch-col-district {
  width: 66px;
}

.branch-name-table .branch-col-address {
  width: auto;
}

.branch-name-table .branch-col-phone {
  width: 112px;
}

.branch-name-table .branch-col-manager {
  width: 68px;
}

.branch-name-table .branch-col-status {
  width: 56px;
}

.branch-name-table .branch-col-note {
  width: 58px;
}

.branch-name-table .site-grid-check {
  overflow: visible;
  text-overflow: clip;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.branch-name-table .branch-code-cell,
.branch-name-table .branch-name-cell,
.branch-name-table .branch-type-cell,
.branch-name-table .branch-city-cell,
.branch-name-table .branch-district-cell,
.branch-name-table .branch-manager-cell,
.branch-name-table .branch-status-cell,
.branch-name-table .branch-note-cell {
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}

.branch-name-table .branch-address-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.branch-name-table td.branch-phone-cell {
  padding-left: 4px;
  padding-right: 4px;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.equipment-name-table {
  min-width: 1360px;
}

.equipment-name-table th:nth-child(1),
.equipment-name-table td:nth-child(1) {
  width: 46px;
}

.equipment-name-table th:nth-child(2),
.equipment-name-table td:nth-child(2) {
  width: 34px;
}

.equipment-name-table th:nth-child(3),
.equipment-name-table td:nth-child(3) {
  width: 78px;
}

.equipment-name-table th:nth-child(4),
.equipment-name-table td:nth-child(4) {
  width: 130px;
}

.equipment-name-table th:nth-child(5),
.equipment-name-table td:nth-child(5),
.equipment-name-table th:nth-child(6),
.equipment-name-table td:nth-child(6) {
  width: 92px;
}

.equipment-name-table th:nth-child(7),
.equipment-name-table td:nth-child(7) {
  width: 210px;
}

.equipment-name-table th:nth-child(8),
.equipment-name-table td:nth-child(8),
.equipment-name-table th:nth-child(9),
.equipment-name-table td:nth-child(9),
.equipment-name-table th:nth-child(10),
.equipment-name-table td:nth-child(10) {
  width: 58px;
}

.equipment-name-table th:nth-child(11),
.equipment-name-table td:nth-child(11),
.equipment-name-table th:nth-child(12),
.equipment-name-table td:nth-child(12),
.equipment-name-table th:nth-child(13),
.equipment-name-table td:nth-child(13),
.equipment-name-table th:nth-child(14),
.equipment-name-table td:nth-child(14) {
  width: 96px;
}

.equipment-name-table th:nth-child(15),
.equipment-name-table td:nth-child(15) {
  width: auto;
}

.equipment-location-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipment-modal-dialog {
  width: min(760px, calc(100vw - 40px));
}

.equipment-form textarea,
.equipment-form .span-2 {
  grid-column: 1 / -1;
}

.cashroom-panel {
  padding: 0;
}

.cashroom-layout {
  gap: 0;
  min-height: calc(100vh - 116px);
}

.cashroom-layout.cashroom-direct-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.cashroom-direct-layout .cashroom-name-panel {
  grid-column: 1;
  width: 100%;
}

.cashroom-name-panel {
  min-width: 0;
}

.cashroom-step-list {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.cashroom-step-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #31475a;
  text-align: left;
}

.cashroom-step-button:hover {
  border-color: #b9cfdf;
  background: #f4f9fc;
}

.cashroom-step-button.active {
  border-color: #238fbe;
  background: #249fce;
  color: #fff;
}

.cashroom-step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #9cb6c8;
  border-radius: 50%;
  background: #fff;
  color: #3d647f;
  font-size: 12px;
  font-weight: 800;
}

.cashroom-step-button.active .cashroom-step-number {
  border-color: #fff;
  color: #187ba5;
}

.cashroom-step-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cashroom-step-copy strong { font-size: 13px; }
.cashroom-step-copy small { overflow: hidden; font-size: 11px; opacity: .78; text-overflow: ellipsis; white-space: nowrap; }
.cashroom-step-button em { font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }

.cashroom-aux-title {
  margin: 4px 8px 0;
  padding: 9px 5px 4px;
  border-top: 1px solid #d6e0e8;
  color: #738494;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.cashroom-guide-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 1fr);
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid #d8e1e8;
  background: linear-gradient(90deg, #f1f8fc, #fff);
}

.cashroom-guide-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cashroom-guide-title > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 4px;
  background: #176b96;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.cashroom-guide-title strong { color: #264a63; font-size: 14px; }
.cashroom-guide-title p { margin: 4px 0 0; color: #607587; font-size: 12px; line-height: 1.5; }
.cashroom-guide-card ol { display: grid; gap: 5px; margin: 0; padding-left: 24px; color: #344e61; font-size: 12px; }
.cashroom-guide-card li::marker { color: #1683b4; font-weight: 800; }

.bodycam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 0;
  border-top: 1px solid #d8e1e8;
}

.bodycam-table-wrap { border-right: 1px solid #d8e1e8; }
.bodycam-video-table {
  min-width: 1120px !important;
  table-layout: fixed;
}
.bodycam-video-table th,
.bodycam-video-table td {
  height: 38px;
  padding: 4px 7px;
  vertical-align: middle;
}
.bodycam-video-table th:nth-child(1),
.bodycam-video-table td:nth-child(1) { width: 42px; text-align: center; }
.bodycam-video-table th:nth-child(2),
.bodycam-video-table td:nth-child(2) { width: 88px; text-align: center; }
.bodycam-video-table th:nth-child(3),
.bodycam-video-table td:nth-child(3) { width: 132px; }
.bodycam-video-table th:nth-child(4),
.bodycam-video-table td:nth-child(4) { width: 70px; text-align: center; }
.bodycam-video-table th:nth-child(5),
.bodycam-video-table td:nth-child(5) { width: 110px; }
.bodycam-video-table th:nth-child(6),
.bodycam-video-table td:nth-child(6) { width: 128px; }
.bodycam-video-table th:nth-child(7),
.bodycam-video-table td:nth-child(7) { width: 76px; text-align: right; }
.bodycam-video-table th:nth-child(8),
.bodycam-video-table td:nth-child(8) { width: 260px; }
.bodycam-video-table th:nth-child(9),
.bodycam-video-table td:nth-child(9) { width: 96px; text-align: center; }
.bodycam-video-table th:nth-child(10),
.bodycam-video-table td:nth-child(10) { width: 74px; text-align: center; }
.bodycam-video-table th:nth-child(11),
.bodycam-video-table td:nth-child(11) { width: 66px; text-align: center; }
.bodycam-video-table code { color: #315b75; font-size: 11px; }
.bodycam-video-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bodycam-upload-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 9px 10px;
  padding: 14px;
  background: #fff;
}

.bodycam-upload-form h3,
.bodycam-upload-form > label:first-of-type,
.bodycam-upload-form .bodycam-file-field,
.bodycam-upload-progress,
.bodycam-upload-form .cashroom-form-hint,
.bodycam-upload-form > button { grid-column: 1 / -1; }

.bodycam-upload-form h3 { margin: 0 0 3px; color: #294b63; font-size: 15px; }
.bodycam-upload-form label { display: grid; gap: 4px; color: #3c5263; font-size: 12px; }
.bodycam-upload-form :is(input, select) { min-width: 0; height: 32px; }

.bodycam-file-field {
  padding: 11px;
  border: 1px dashed #72a8c7;
  border-radius: 6px;
  background: #f3f9fc;
}

.bodycam-file-field input { height: auto; }
.bodycam-file-field small { color: #677d8c; }

.bodycam-upload-progress {
  display: grid;
  gap: 5px;
}

.bodycam-upload-progress > div { display: flex; justify-content: space-between; color: #455f70; font-size: 12px; }
.bodycam-upload-progress progress { width: 100%; height: 12px; accent-color: #1689ba; }

.bodycam-upload-form > button {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: #087fb4;
  color: #fff;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .cashroom-guide-card { grid-template-columns: 1fr; gap: 10px; }
  .bodycam-layout { grid-template-columns: 1fr; }
  .bodycam-table-wrap { border-right: 0; }
}

.cashroom-count-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
  min-height: 0;
  border-top: 1px solid #d8e1e8;
}

.cashroom-count-grid > .site-grid-wrap {
  border-right: 1px solid #d8e1e8;
}

.cash-denomination-form {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  border: 0;
  background: #fff;
}

.cash-denomination-form h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: #2f4050;
  font-size: 14px;
  font-weight: 700;
}

.cash-denomination-form label {
  gap: 2px;
  color: #33475a;
  font-size: 13px;
}

.cash-denomination-form input,
.cash-denomination-form select {
  height: 28px;
  min-height: 28px;
  padding: 3px 6px;
  border-radius: 0;
}

select[data-cashroom-status-filter],
.cash-denomination-form select[name="bagNo"] {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px !important;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #41637a 50%),
    linear-gradient(135deg, #41637a 50%, transparent 50%);
  background-position:
    calc(100% - 11px) 50%,
    calc(100% - 7px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

select[data-cashroom-status-filter] {
  min-width: 100px;
}

.cash-denomination-form label:has(select[name="bagNo"]) {
  grid-column: 1 / -1;
}

.cash-denomination-form select[name="bagNo"] {
  width: 100%;
  min-width: 0;
}

.cash-denomination-form button {
  min-height: 30px;
  padding: 4px 10px;
}

.cash-denomination-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.cashroom-subtitle {
  height: 28px;
  padding: 6px 8px;
  border-top: 1px solid #d8e1e8;
  border-bottom: 1px solid #d8e1e8;
  background: linear-gradient(180deg, #ffffff, #f1f4f6);
  color: #2f4050;
  font-size: 13px;
}

.cashroom-name-table {
  min-width: 920px;
}

.cashroom-name-table th,
.cashroom-name-table td {
  height: 28px;
  padding-top: 2px;
  padding-bottom: 2px;
  vertical-align: middle;
}

.cashroom-name-table td {
  text-align: center;
}

.cashroom-name-table th:nth-child(3),
.cashroom-name-table td:nth-child(3),
.cashroom-name-table th:nth-child(4),
.cashroom-name-table td:nth-child(4) {
  text-align: left;
}

.cashroom-name-table button {
  min-height: 24px;
  padding: 2px 8px;
}

@media (max-width: 1180px) {
  .cashroom-count-grid {
    grid-template-columns: 1fr;
  }

  .cashroom-count-grid > .site-grid-wrap {
    border-right: 0;
  }
}

.vehicle-name-table th:nth-child(1),
.vehicle-name-table td:nth-child(1) {
  width: 46px;
  text-align: center;
}

.vehicle-name-table th:nth-child(2),
.vehicle-name-table td:nth-child(2) {
  width: 32px;
  text-align: center;
}

.vehicle-name-table th:nth-child(3),
.vehicle-name-table td:nth-child(3),
.vehicle-name-table th:nth-child(4),
.vehicle-name-table td:nth-child(4),
.vehicle-name-table th:nth-child(6),
.vehicle-name-table td:nth-child(6),
.vehicle-name-table th:nth-child(10),
.vehicle-name-table td:nth-child(10) {
  width: 88px;
  text-align: center;
}

.vehicle-name-table th:nth-child(5),
.vehicle-name-table td:nth-child(5),
.vehicle-name-table th:nth-child(8),
.vehicle-name-table td:nth-child(8),
.vehicle-name-table th:nth-child(15),
.vehicle-name-table td:nth-child(15) {
  width: 106px;
  text-align: center;
}

.vehicle-name-table th:nth-child(7),
.vehicle-name-table td:nth-child(7) {
  width: 130px;
}

.vehicle-name-table th:nth-child(9),
.vehicle-name-table td:nth-child(9) {
  width: 136px;
  text-align: center;
}

.vehicle-name-table th:nth-child(11),
.vehicle-name-table td:nth-child(11),
.vehicle-name-table th:nth-child(12),
.vehicle-name-table td:nth-child(12),
.vehicle-name-table th:nth-child(13),
.vehicle-name-table td:nth-child(13),
.vehicle-name-table th:nth-child(14),
.vehicle-name-table td:nth-child(14) {
  width: 104px;
  text-align: center;
}

.vehicle-name-table th:nth-child(16),
.vehicle-name-table td:nth-child(16) {
  width: auto;
}

.aps-name-table {
  min-width: 1980px;
}

.aps-name-table th:nth-child(1),
.aps-name-table td:nth-child(1) {
  width: 46px;
  text-align: center;
}

.aps-name-table th:nth-child(2),
.aps-name-table td:nth-child(2) {
  width: 32px;
  text-align: center;
}

.aps-name-table th:nth-child(3),
.aps-name-table td:nth-child(3) {
  width: 120px;
  text-align: center;
}

.aps-name-table th:nth-child(4),
.aps-name-table td:nth-child(4),
.aps-name-table th:nth-child(10),
.aps-name-table td:nth-child(10),
.aps-name-table th:nth-child(16),
.aps-name-table td:nth-child(16) {
  width: 110px;
  text-align: center;
}

.aps-name-table th:nth-child(5),
.aps-name-table td:nth-child(5),
.aps-name-table th:nth-child(7),
.aps-name-table td:nth-child(7),
.aps-name-table th:nth-child(11),
.aps-name-table td:nth-child(11),
.aps-name-table th:nth-child(14),
.aps-name-table td:nth-child(14) {
  width: 86px;
  text-align: center;
}

.aps-name-table th:nth-child(6),
.aps-name-table td:nth-child(6) {
  width: 220px;
}

.aps-name-table th:nth-child(8),
.aps-name-table td:nth-child(8),
.aps-name-table th:nth-child(9),
.aps-name-table td:nth-child(9),
.aps-name-table th:nth-child(12),
.aps-name-table td:nth-child(12),
.aps-name-table th:nth-child(15),
.aps-name-table td:nth-child(15) {
  width: 76px;
  text-align: center;
}

.aps-name-table th:nth-child(13),
.aps-name-table td:nth-child(13),
.aps-name-table th:nth-child(20),
.aps-name-table td:nth-child(20) {
  width: 92px;
  text-align: center;
}

.aps-name-table th:nth-child(17),
.aps-name-table td:nth-child(17),
.aps-name-table th:nth-child(18),
.aps-name-table td:nth-child(18) {
  width: 128px;
  text-align: center;
}

.aps-name-table th:nth-child(19),
.aps-name-table td:nth-child(19) {
  width: 104px;
  text-align: center;
}

.aps-name-table th:nth-child(21),
.aps-name-table td:nth-child(21) {
  width: auto;
}

.site-name-table tbody tr[data-site-row] {
  cursor: default;
}

.site-name-table tbody tr[data-vehicle-row],
.site-name-table tbody tr[data-aps-row] {
  cursor: default;
}

.site-name-table tbody tr[data-site-row]:nth-child(even) td {
  background: #f6f8fa;
}

.site-name-table tbody tr[data-vehicle-row]:nth-child(even) td,
.site-name-table tbody tr[data-aps-row]:nth-child(even) td {
  background: #f6f8fa;
}

.site-name-table tbody tr.selected td {
  background: #e7f1fb;
}

.site-name-table tbody tr[data-site-row]:hover td,
.site-name-table tbody tr[data-site-row]:focus-visible td,
.site-name-table tbody tr[data-vehicle-row]:hover td,
.site-name-table tbody tr[data-vehicle-row]:focus-visible td,
.site-name-table tbody tr[data-aps-row]:hover td,
.site-name-table tbody tr[data-aps-row]:focus-visible td {
  background: #f1f8fd;
  outline: 0;
}

.site-name-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-name-cell,
.site-address-cell,
.planner-site-cell,
.planner-address-cell,
.pdf-site-cell,
.pdf-address-cell,
.branch-address-cell,
td[data-field="name"],
td[data-field="address"] {
  text-align: left !important;
}

input[name="name"],
input[name="address"],
input[name="siteName"],
textarea[name="address"] {
  text-align: left !important;
}

.site-grid-index {
  color: #5f718a;
}

.site-grid-check input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

input[data-dispatch-route-check],
input[data-dispatch-route-check-all] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.personnel-table th:nth-child(2),
.personnel-table td:nth-child(2) {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.personnel-table input[data-personnel-check],
.personnel-table input[data-personnel-check-all] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.site-grid-name,
.site-name-table em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-name-table em {
  margin-top: 1px;
  color: #8a97a3;
  font-size: 11px;
  font-style: normal;
}

.site-grid-empty {
  height: 62px !important;
  color: #ff2f2f !important;
  text-align: center;
}

.site-grid-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 8px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fafafa, #eeeeee);
  color: #555;
  font-size: 12px;
}

.site-grid-pager select,
.site-grid-pager input,
.site-grid-pager button {
  flex: 0 0 auto;
  height: 24px;
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid #cdd7df;
  background: #fff;
  font-size: 12px;
}

.site-grid-pager button {
  width: 24px;
  min-width: 24px;
  border-color: transparent;
  background: transparent;
  color: #54616c;
}

.site-grid-pager button:disabled {
  color: #aab4bd;
  cursor: default;
}

.site-grid-pager select {
  width: 60px;
  min-width: 60px;
}

.site-grid-pager input {
  width: 38px;
  text-align: center;
}

.site-grid-pager span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.site-grid-pager strong {
  margin-left: auto;
  font-weight: 400;
}

.site-name-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
}

.site-name-item:hover,
.site-name-item:focus-visible {
  background: #f1f8fd;
  outline: 0;
}

.site-name-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #2a8bc2;
}

.site-name-icon::before {
  content: "\25a6";
  font-size: 13px;
}

.site-name-item strong,
.site-name-item em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-name-item strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.site-name-item em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.site-name-item .danger-text {
  min-height: 26px;
  padding: 2px 8px;
  opacity: .82;
}

.billing-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

.billing-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.billing-toolbar input {
  width: 190px;
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.billing-summary div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}

.billing-summary span {
  color: var(--muted);
  font-size: 13px;
}

.approval-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.approval-summary div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbff;
}

.approval-summary span,
.approval-meta {
  color: var(--muted);
  font-size: 13px;
}

.approval-summary strong {
  font-size: 24px;
}

.approval-table {
  min-width: 1080px;
}

.approval-table th:nth-child(2),
.approval-table td:nth-child(2) {
  min-width: 180px;
}

.approval-table th:nth-child(3),
.approval-table td:nth-child(3) {
  min-width: 260px;
}

.billing-status-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 18px 12px;
  align-items: end;
}

.billing-status-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.billing-status-form input,
.billing-status-form select {
  width: 100%;
}

.billing-status-form button {
  min-height: 42px;
}

.billing-note {
  grid-column: span 2;
}

.billing-readonly {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.billing-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 12px;
  color: var(--muted);
  font-size: 13px;
}

.billing-table th,
.billing-table td {
  padding-top: 7px;
  padding-bottom: 7px;
  vertical-align: middle;
}

.site-group {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.site-group:last-child {
  border-bottom: 0;
}

.site-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
}

.site-group header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.site-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.site-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 36, .45);
}

.site-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-dialog {
  width: min(420px, calc(100vw - 40px));
}

.site-modal-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.site-modal-dialog h3 {
  margin: 0;
}

.site-modal-dialog header button {
  min-height: 34px;
  padding: 6px 10px;
  background: #edf5f2;
  color: var(--accent);
}

.route-plan-manager-dialog {
  width: min(980px, calc(100vw - 40px));
}

.route-plan-manager-hint {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.route-plan-manager-table-wrap {
  max-height: min(62vh, 560px);
  overflow: auto;
}

.route-plan-manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.route-plan-manager-table th,
.route-plan-manager-table td {
  height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.route-plan-manager-table th {
  background: #eef5f9;
  color: var(--ink);
  font-weight: 400;
  text-align: center;
}

.route-plan-manager-table tr.is-active td {
  background: #e8f6ff;
}

.route-plan-manager-empty {
  color: var(--muted);
  text-align: center;
}

.route-plan-manager-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.route-plan-manager-actions button {
  min-height: 24px;
  padding: 2px 8px;
}

.route-plan-manager-actions .danger {
  border-color: #f2b8b5;
  background: #fff5f5;
  color: #c62828;
}

.confirm-content {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.confirm-content strong {
  color: var(--ink);
  font-size: 18px;
}

.confirm-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.account-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.account-tools input,
.account-tools select {
  width: auto;
  min-width: 140px;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.account-tools input {
  min-width: 220px;
}

.account-tools button {
  min-height: 36px;
  padding: 8px 12px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.panel-actions button {
  min-height: 36px;
  padding: 8px 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #edf5f2;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.tag.warn {
  background: #fff3df;
  color: #986515;
}

.tag.danger {
  background: #fde9e9;
  color: var(--danger);
}

.action-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.field-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px;
}

.field-actions.single-action {
  grid-template-columns: minmax(180px, 360px);
}

.field-action {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: center;
}

.field-action.danger-action {
  border-color: #efb6b6;
  color: var(--danger);
  background: #fff8f8;
}

.guard-mobile-shell {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
}

.guard-mobile-hero,
.guard-current-stop,
.guard-collection-card,
.guard-stop-list,
.guard-proof-form,
.guard-mobile-routes {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(12, 38, 68, .08);
}

.guard-mobile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #145a94, #1d85c8);
}

.guard-mobile-kicker,
.guard-mobile-hero p,
.guard-mobile-metrics span {
  color: rgba(255,255,255,.84);
}

.guard-mobile-hero h2 {
  margin: 4px 0;
  font-size: 30px;
}

.guard-mobile-metrics {
  min-width: 96px;
  padding: 12px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255,255,255,.16);
}

.guard-mobile-metrics strong {
  display: block;
  font-size: 28px;
}

.guard-mobile-logout {
  grid-column: 1 / -1;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.14);
  font-weight: 800;
}

.guard-date-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guard-date-switch button {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #163b5c;
  background: #fff;
  text-align: left;
  font: inherit;
  box-shadow: 0 8px 18px rgba(12, 38, 68, .06);
}

.guard-date-switch button.active {
  border-color: #1174ad;
  color: #fff;
  background: #1767a6;
}

.guard-date-switch button span {
  color: #60758b;
  font-size: 13px;
}

.guard-date-switch button.active span {
  color: rgba(255,255,255,.82);
}

.guard-preview-banner,
.guard-preview-lock-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #f1d999;
  color: #7a5200;
  background: #fff8df;
  font-weight: 800;
  line-height: 1.45;
}

.guard-preview-lock-note {
  display: grid;
  align-content: center;
  min-height: 74px;
  border-color: #d7e0ea;
  color: #4f6376;
  background: #f3f7fb;
  font-weight: 700;
}

.guard-mobile-routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
}

.guard-mobile-route,
.guard-stop-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  text-align: left;
}

.guard-mobile-route {
  display: grid;
  gap: 4px;
  padding: 13px;
}

.guard-mobile-route.active,
.guard-stop-item.active {
  border-color: #1b82bd;
  background: #e9f6ff;
}

.guard-current-stop {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.guard-stop-count {
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  color: #0f5d92;
  font-weight: 800;
  background: #e9f6ff;
}

.guard-current-stop h3 {
  margin: 0;
  font-size: 28px;
}

.guard-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.guard-proof-strip span {
  padding: 9px;
  border-radius: 12px;
  background: #f4f7fb;
  color: #496076;
}

.guard-collection-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.guard-step-locked {
  border-color: #d7e0ea;
}

.guard-step-lock-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7e6;
  color: #9a5b00;
  font-weight: 700;
}

.guard-collection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guard-collection-head span,
.guard-collection-note,
.guard-collection-list span,
.guard-collection-list em {
  color: #60758b;
}

.guard-collection-head h3 {
  margin: 2px 0 0;
  font-size: 24px;
}

.guard-collection-head strong {
  min-width: 64px;
  padding: 10px;
  border-radius: 14px;
  text-align: center;
  color: #0f5d92;
  background: #e9f6ff;
}

.guard-collection-note {
  margin: 0;
}

.guard-collection-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guard-collection-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.guard-collection-form select,
.guard-collection-form input {
  min-height: 48px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

.guard-collection-submit {
  grid-column: 1 / -1;
  background: #16804f;
}

.guard-collection-list {
  display: grid;
  gap: 8px;
}

.guard-collection-list div,
.guard-collection-list em {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f7fb;
}

.guard-collection-list div {
  display: grid;
  gap: 3px;
}

.guard-big-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guard-big-button {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: #1767a6;
  box-shadow: 0 10px 20px rgba(23,103,166,.18);
  text-align: left;
  text-decoration: none;
}

.guard-big-button strong {
  font-size: 20px;
}

.guard-big-button span {
  color: rgba(255,255,255,.82);
}

.guard-big-button:disabled,
.guard-big-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .45;
  filter: grayscale(.25);
  box-shadow: none;
}

.guard-big-button.danger-action {
  background: #d94e58;
}

.guard-navigation-button {
  min-height: 74px;
  background: #0b8f78;
}

.guard-map-panel {
  padding: 0 14px 14px;
}

.guard-map-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #b9d7ee;
  border-radius: 18px;
  background: #f6fbff;
  box-shadow: 0 10px 22px rgba(12, 79, 125, .12);
}

.guard-map-card > strong {
  color: #12395c;
  font-size: 18px;
}

.guard-map-card > span,
.guard-map-card > em {
  color: #526b82;
  font-style: normal;
  line-height: 1.45;
}

.guard-map-card > em {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
}

.guard-map-secondary {
  min-height: 48px;
  border: 1px solid #b9d7ee;
  border-radius: 12px;
  color: #0d5687;
  background: #fff;
  font-weight: 800;
}

.guard-photo-panel {
  padding: 0 14px 14px;
}

.guard-photo-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #b9d7ee;
  border-radius: 18px;
  background: #f6fbff;
  box-shadow: 0 10px 22px rgba(12, 79, 125, .12);
}

.guard-photo-card > strong {
  color: #12395c;
  font-size: 18px;
}

.guard-photo-card > span {
  color: #526b82;
  line-height: 1.45;
}

.guard-file-option {
  position: relative;
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: #1767a6;
  box-shadow: 0 10px 20px rgba(23,103,166,.18);
}

.guard-file-option span {
  color: rgba(255,255,255,.82);
}

.guard-file-camera {
  background: #0b8f78;
}

.guard-web-camera-button {
  background: #0b8f78;
}

.guard-web-camera {
  display: grid;
  gap: 10px;
}

.guard-web-camera video {
  width: 100%;
  max-height: 360px;
  border-radius: 16px;
  background: #001827;
  object-fit: cover;
}

.guard-camera-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.guard-camera-controls button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: #1767a6;
  color: #fff;
  font-weight: 800;
}

.guard-camera-controls button + button {
  background: #6b7c8d;
}

.guard-web-camera small {
  color: #526b82;
  line-height: 1.4;
}

.guard-native-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.guard-stop-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guard-stop-switcher button {
  min-height: 58px;
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #cfe0ee;
  border-radius: 14px;
  background: #f8fbff;
  color: #12395c;
  text-align: left;
}

.guard-stop-switcher button strong {
  font-size: 16px;
}

.guard-stop-switcher button span {
  font-size: 13px;
  color: #60758a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guard-stop-switcher button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.tracking-board {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) var(--tracking-message-height, 126px);
  gap: 0;
  min-height: 0;
  border: 1px solid #c8d3de;
  border-radius: 0;
  background: #fff;
  overflow: hidden;
}

.tracking-board-head,
.tracking-actions,
.tracking-summary,
.tracking-legend,
.tracking-route-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tracking-board-head {
  min-height: 39px;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid #c7d2dd;
  background: linear-gradient(180deg, #ffffff, #edf3f7);
}

.tracking-board-head h3 {
  margin: 0;
  color: #4f5b66;
  font-size: 15px;
  font-weight: 700;
}

.tracking-board-head p,
.tracking-board-time,
.tracking-route-head span {
  margin: 0;
  color: #526b82;
  font-size: 12px;
}

.tracking-summary {
  min-height: 34px;
  padding: 4px 10px;
  border-bottom: 1px solid #d7e0e8;
  background: #f7fbfd;
  flex-wrap: wrap;
}

.tracking-summary span {
  display: inline-flex;
  align-items: center;
  min-width: 88px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #d8e3ed;
  border-radius: 2px;
  background: #fff;
  color: #2d4964;
  font-size: 12px;
}

.tracking-summary b {
  margin-right: 5px;
  color: #0b2f5b;
  font-size: 18px;
  line-height: 1;
}

.tracking-actions {
  min-height: 34px;
  justify-content: space-between;
  padding: 4px 10px;
  border-bottom: 1px solid #d7e0e8;
  background: #fff;
  flex-wrap: nowrap;
}

.tracking-actions .tool-row {
  flex: 1 1 auto;
  padding: 0;
}

.tracking-actions .panel-action {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #0c6fb1;
  border-radius: 2px;
  background: #fff;
  color: #0c5f9d;
}

.tracking-legend {
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 4px 10px;
  border-bottom: 1px solid #d7e0e8;
  background: #f7fbfd;
}

.tracking-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #31485f;
  font-size: 12px;
}

.tracking-legend i {
  width: 18px;
  height: 12px;
  border: 1px solid #17324f;
  display: inline-block;
}

.tracking-legend i.done { background: #0f24ff; }
.tracking-legend i.active { background: #ff1515; }
.tracking-legend i.next { background: #08723a; }
.tracking-legend i.pending { background: #9b7659; }

.tracking-route-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding: 8px;
  overflow: auto;
}

.tracking-route-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  min-height: 150px;
  padding: 8px;
  border: 1px solid #d7e2ee;
  border-radius: 2px;
  background: #fbfdff;
  overflow: hidden;
}

.tracking-route-head {
  justify-content: space-between;
  min-width: 0;
}

.tracking-route-head strong {
  display: block;
  color: #0b2f5b;
  font-size: 14px;
}

.tracking-route-progress {
  text-align: right;
  min-width: 52px;
}

.tracking-route-progress b {
  display: block;
  font-size: 18px;
  color: #1767a6;
  line-height: 1.1;
}

.tracking-flow {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 144px);
  justify-content: start;
  align-items: center;
  align-content: flex-start;
  gap: 8px 0;
  overflow: visible;
  padding: 6px 2px 4px;
}

.tracking-flow-segment {
  width: 144px;
  display: grid;
  grid-template-columns: 26px 118px;
  align-items: center;
  margin: 0;
}

.tracking-flow > .tracking-stop-card.origin {
  width: 118px;
  justify-self: start;
}

.tracking-arrow {
  width: 26px;
  height: 2px;
  background: #1f2d3d;
  position: relative;
  flex: 0 0 26px;
  overflow: visible;
}

.tracking-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  border-left: 10px solid #1f2d3d;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.tracking-arrow.moving {
  background: linear-gradient(90deg, #1f2d3d 0%, #1f2d3d 28%, #0ea5e9 46%, #10b981 58%, #1f2d3d 76%, #1f2d3d 100%);
  background-size: 52px 2px;
  animation: trackingArrowFlow .75s linear infinite;
}

.tracking-arrow.moving::after {
  border-left-color: #0ea5e9;
  animation: trackingArrowHeadPulse .75s ease-in-out infinite;
}

.tracking-arrow.moving::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(14,165,233,.8);
  animation: trackingArrowDot .75s linear infinite;
}

@keyframes trackingArrowFlow {
  from { background-position: 0 0; }
  to { background-position: 52px 0; }
}

@keyframes trackingArrowDot {
  from { transform: translateX(0); opacity: .2; }
  35% { opacity: 1; }
  to { transform: translateX(24px); opacity: .2; }
}

@keyframes trackingArrowHeadPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

.tracking-stop-card {
  width: 118px;
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 7px;
  border: 2px solid #111;
  color: #fff;
  background: #9b7659;
  text-align: center;
  line-height: 1.15;
}

.tracking-stop-card small {
  opacity: .85;
  font-weight: 700;
  font-size: 10px;
}

.tracking-stop-card strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.15;
}

.tracking-aps-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  min-height: 16px;
  margin: 1px 0;
}

.tracking-aps-chip {
  min-width: 20px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.tracking-aps-chip.done {
  background: #0f24ff;
}

.tracking-aps-chip.active {
  background: #ff1515;
  animation: trackingApsPulse 1.2s ease-in-out infinite;
}

.tracking-aps-chip.next {
  background: #08723a;
}

.tracking-aps-chip.pending {
  background: rgba(255,255,255,.16);
}

@keyframes trackingApsPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.45); }
}

.tracking-stop-card em {
  font-style: normal;
  font-size: 11px;
  opacity: .95;
}

.tracking-stop-card.origin,
.tracking-stop-card.pending {
  background: #9b7659;
}

.tracking-stop-card.done {
  background: #0f24ff;
}

.tracking-stop-card.next {
  background: #08723a;
}

.tracking-stop-card.danger {
  background: #b00020;
}

.tracking-stop-card.active {
  background: linear-gradient(120deg, #ff1515, #ff7a00, #ff1515);
  background-size: 220% 220%;
  animation: trackingPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(255,21,21,.45);
}

@keyframes trackingPulse {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 0 rgba(255,21,21,.35);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 0 8px rgba(255,21,21,.08);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 0 rgba(255,21,21,.35);
  }
}

.tracking-empty-route {
  padding: 16px;
  color: #60758a;
}

.tracking-message-box {
  position: relative;
  min-height: 0;
  border-top: 1px solid #9aa7b3;
  background: #fff;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr);
}

.tracking-message-resizer {
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 12px;
  z-index: 4;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M8 7l4-4 4 4M8 17l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 12 12, row-resize;
  touch-action: none;
}

.tracking-message-resizer::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 62px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #111;
}

.tracking-message-resizer:hover::after,
.tracking-message-resizer.is-resizing::after {
  background: #111;
}

body.tracking-message-resizing {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M8 7l4-4 4 4M8 17l4 4 4-4' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 12 12, row-resize;
  user-select: none;
}

.tracking-message-box header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 4px 10px;
  border-bottom: 1px solid #d7e0e8;
  background: linear-gradient(180deg, #ffffff, #edf3f7);
  color: #4f5b66;
}

.tracking-message-box header strong {
  color: #0b2f5b;
  font-size: 13px;
}

.tracking-message-box header span {
  color: #60758a;
  font-size: 12px;
}

.tracking-message-list {
  overflow: auto;
  padding: 4px 8px;
  background: #fff;
}

.tracking-message-item {
  display: grid;
  grid-template-columns: 132px 78px 106px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 2px 0;
  border-bottom: 1px solid #edf2f6;
  color: #17324f;
  font-size: 12px;
}

.tracking-message-item time {
  color: #526b82;
}

.tracking-message-item strong {
  color: #0b2f5b;
}

.tracking-message-item span {
  display: inline-flex;
  justify-content: center;
  padding: 1px 6px;
  border: 1px solid #b9d4e8;
  border-radius: 2px;
  background: #eef7ff;
  color: #0c5f9d;
}

.tracking-message-item p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracking-message-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 1px 6px;
  border: 1px solid #0b78bd;
  border-radius: 2px;
  background: #fff;
  color: #0b78bd;
  font-size: 12px;
  text-decoration: none;
}

.tracking-message-link:hover {
  background: #eaf6ff;
}

.tracking-message-empty {
  padding: 10px;
  color: #60758a;
  font-size: 12px;
}

.guard-big-actions > .guard-navigation-button {
  display: none;
}

.guard-stop-address {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #41576d;
  background: #f4f7fb;
}

.guard-empty-task-hint {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #f2d8a8;
  border-radius: 14px;
  color: #6f4f12;
  background: #fff8e8;
}

.guard-empty-task-hint strong {
  font-size: 18px;
}

.guard-empty-task-hint span {
  color: #765b29;
}

.guard-empty-task-hint button {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #b7791f;
  font-weight: 800;
}

.guard-photo-actions .guard-big-button {
  background: #274e70;
}

.guard-proof-form {
  padding: 14px;
}

.guard-form-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guard-form-buttons button {
  min-height: 48px;
}

.guard-stop-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.guard-stop-list h3 {
  margin: 0 0 4px;
}

.guard-stop-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 4px 10px;
  padding: 12px;
}

.guard-stop-item span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: #1b82bd;
}

.guard-stop-item em {
  color: #62758b;
  font-style: normal;
}

.pwa-install-prompt {
  position: fixed;
  inset: auto 0 0;
  z-index: 9999;
  display: grid;
  place-items: end center;
  padding: 14px;
  background: linear-gradient(180deg, rgba(6,24,42,0), rgba(6,24,42,.42));
}

.pwa-install-card {
  position: relative;
  width: min(100%, 430px);
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.24);
}

.pwa-install-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #536273;
  background: #eef3f8;
  font-size: 24px;
}

.pwa-install-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: #1767a6;
  font-size: 24px;
}

.pwa-install-card h3 {
  margin: 0;
  font-size: 24px;
}

.pwa-install-card p {
  margin: 0;
  color: #4f6175;
}

.pwa-install-card ol {
  margin: 0;
  padding-left: 22px;
  color: #172b43;
  line-height: 1.8;
}

.pwa-install-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pwa-install-actions button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  font-weight: 800;
}

.pwa-install-actions button:first-child {
  border-color: #1767a6;
  color: #fff;
  background: #1767a6;
}

.proof-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.proof-summary div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.proof-summary span,
.proof-form p {
  color: var(--muted);
  font-size: 12px;
}

.proof-summary strong {
  font-size: 13px;
}

.proof-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.proof-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.proof-form input,
.proof-form select {
  width: 100%;
}

.proof-note {
  grid-column: span 2;
}

.proof-form p {
  align-self: center;
  margin: 0;
}

.guard-task-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px 0;
}

.guard-route-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px 0;
}

.guard-route-tab {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.guard-route-tab.active {
  border-color: var(--accent);
  background: #edf8f5;
}

.dispatch-plan-summary {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf9;
}

.dispatch-plan-summary span,
.dispatch-plan-summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.dispatch-delete-plan-button {
  justify-self: start;
  color: var(--danger);
  border-color: #f0b9b9;
  background: #fff;
}

.dispatch-delete-plan-button:hover {
  background: #fff5f5;
}

.dispatch-workbench {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.dispatch-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.dispatch-section.create {
  background: #f5f9ff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.section-title div {
  display: grid;
  gap: 2px;
}

.section-title strong {
  color: var(--ink);
  font-size: 17px;
}

.section-title em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.dispatch-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dispatch-create-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.dispatch-create-box h4 {
  margin: 0;
  color: var(--brand);
  font-size: 15px;
}

.dispatch-create-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dispatch-card-list {
  display: grid;
  gap: 8px;
}

.dispatch-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.dispatch-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
}

.dispatch-card-head div {
  display: grid;
  gap: 2px;
}

.dispatch-card-head strong {
  color: var(--ink);
  font-size: 16px;
}

.dispatch-card-head em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.dispatch-card-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 1fr;
  gap: 8px;
}

.dispatch-card-grid.compact {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.dispatch-card-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dispatch-card-grid input,
.dispatch-card-grid select {
  width: 100%;
}

.dispatch-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.dispatch-card-actions button {
  min-height: 32px;
  padding: 5px 12px;
}

.dispatch-browser {
  grid-template-columns: 310px minmax(0, 1fr);
}

.dispatch-list-panel {
  min-width: 0;
}

.dispatch-tables {
  display: grid;
  grid-template-rows: auto auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.dispatch-table-block {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

.dispatch-table-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 5px 8px;
  border-bottom: 1px solid #d7e0e8;
  background: #f7fafc;
  color: #33475a;
  font-size: 13px;
}

.dispatch-table-block > header span {
  color: #6b7885;
  font-size: 12px;
}

.dispatch-name-table {
  min-width: 980px;
}

.dispatch-task-table {
  min-width: 1180px;
}

.dispatch-name-table th:nth-child(1),
.dispatch-name-table td:nth-child(1) {
  width: 46px;
}

.dispatch-name-table th:nth-child(2),
.dispatch-name-table td:nth-child(2) {
  width: 150px;
}

.dispatch-name-table th:nth-child(3),
.dispatch-name-table td:nth-child(3),
.dispatch-name-table th:nth-child(4),
.dispatch-name-table td:nth-child(4) {
  width: 110px;
}

.dispatch-name-table th:last-child,
.dispatch-name-table td:last-child {
  width: 120px;
}

.dispatch-route-select-table th:nth-child(1),
.dispatch-route-select-table td:nth-child(1) {
  width: 46px;
  text-align: center;
}

.dispatch-route-select-table th:nth-child(2),
.dispatch-route-select-table td:nth-child(2) {
  width: 32px;
  text-align: center;
}

.dispatch-route-select-table th:nth-child(3),
.dispatch-route-select-table td:nth-child(3) {
  width: 150px;
}

.dispatch-route-select-table th:nth-child(4),
.dispatch-route-select-table td:nth-child(4),
.dispatch-route-select-table th:nth-child(5),
.dispatch-route-select-table td:nth-child(5) {
  width: 110px;
  text-align: center;
}

.dispatch-route-select-table th:nth-child(6),
.dispatch-route-select-table td:nth-child(6) {
  width: 240px;
}

.dispatch-route-select-table th:nth-child(7),
.dispatch-route-select-table td:nth-child(7),
.dispatch-route-select-table th:nth-child(8),
.dispatch-route-select-table td:nth-child(8) {
  width: 120px;
  text-align: center;
}

.dispatch-route-input {
  min-width: 120px;
}

.dispatch-time-input {
  min-width: 86px;
}

.dispatch-modal-dialog {
  width: min(980px, calc(100vw - 40px));
}

.dispatch-create-modal-grid {
  padding: 12px;
}

.dispatch-tables-single {
  grid-template-rows: auto;
  align-content: start;
}

.dispatch-tables-single .dispatch-table-block {
  min-height: 0;
  display: block;
}

.dispatch-list-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.dispatch-tracking-hint {
  min-height: 26px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  background: #fff8e6;
  color: #7a4b00;
  font-size: 13px;
  line-height: 1.25;
}

.dispatch-create-box-wide {
  grid-column: 1 / -1;
}

.guard-task-tab {
  display: grid;
  flex: 0 0 190px;
  gap: 4px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.guard-task-tab.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #f4faf8;
}

.guard-task-tab span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guard-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.guard-progress div {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.guard-progress div span {
  height: 5px;
  border-radius: 999px;
  background: #dce5e2;
}

.guard-progress div.done span {
  background: var(--ok);
}

.field-incident-panel {
  margin: 0 16px 16px;
  border: 1px solid #efb6b6;
  border-radius: 8px;
  background: #fffafa;
}

.panel-action {
  min-height: 34px;
  padding: 6px 10px;
  background: #edf5f2;
  color: var(--accent);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  padding: 16px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.settings-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.settings-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.settings-section h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
}

.settings-section .textarea-field {
  grid-column: 1 / -1;
}

.settings-section textarea[name="loginCarouselImages"] {
  min-height: 128px;
  line-height: 1.6;
}

.settings-save {
  justify-self: end;
  width: auto;
}

.planner-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
  padding: 16px;
}

.planner-form label {
  margin-bottom: 0;
}

.planner-form button {
  align-self: end;
}

.planner-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.planner-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
}

.planner-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.planner-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.planner-note {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
  font-weight: 700;
}

.planner-note strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
}

.planner-map-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.planner-map-toolbar button {
  flex: 0 0 auto;
  width: auto;
}

.planner-map-toolbar span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}


.planner-map-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.planner-map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 25, 38, 0.46);
}

.planner-map-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid #9fb8ca;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(12, 25, 38, 0.28);
}

.planner-map-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d8e4ec;
  background: #f7fafc;
}

.planner-map-dialog > header div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.planner-map-dialog > header .planner-map-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.planner-map-dialog > header strong {
  color: #17324d;
  font-size: 16px;
}

.planner-map-dialog > header span {
  overflow: hidden;
  color: #5e7080;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-map-dialog > header button {
  height: 28px;
  padding: 3px 12px;
  border: 1px solid #9fc4df;
  border-radius: 3px;
  background: #ffffff;
  color: #174d72;
  font-weight: 700;
}

.planner-map-dialog-body {
  min-height: 0;
  overflow: auto;
}

.planner-map-dialog .planner-day-map-panel {
  height: 100%;
  min-height: min(680px, calc(100vh - 110px));
  margin: 0;
  border: 0;
}

.planner-day-map-panel {
  display: grid;
  gap: 10px;
  margin: 8px 0 12px;
  border-top: 1px solid #d9e4ec;
  border-bottom: 1px solid #d9e4ec;
  background: #f8fbfd;
}

.planner-day-map-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 12px 0;
  color: #33475a;
  font-size: 13px;
}

.planner-day-map-header label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.planner-day-map-header select {
  height: 24px;
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid #cdd7df;
  border-radius: 3px;
  background: #ffffff;
  color: #33475a;
  font-size: 12px;
}

.planner-day-map-header strong {
  color: #17324d;
}

.planner-day-map-header span,
.planner-day-map-header em {
  color: #5e7080;
  font-style: normal;
  font-weight: 700;
}

.planner-day-map-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 360px);
  gap: 10px;
  padding: 0 12px 12px;
}

.planner-day-map {
  min-height: 360px;
  border: 1px solid #cddbe6;
  background: #eaf1f6;
}

.planner-map-empty {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 320px;
  color: #5e7080;
  font-weight: 700;
}

.planner-map-routes {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.planner-map-route {
  border: 1px solid #d8e2ea;
  background: #ffffff;
}

.planner-map-route header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #e5edf3;
  color: #33475a;
  font-size: 13px;
}

.planner-map-route header span {
  color: #6a7c8d;
}

.planner-map-route header a {
  margin-left: auto;
  color: #0b75b7;
  font-weight: 700;
  text-decoration: none;
}

.planner-map-route ol {
  display: grid;
  gap: 0;
  max-height: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.planner-map-route li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid #eef3f7;
  color: #33475a;
  font-size: 12px;
}

.planner-map-route li:last-child {
  border-bottom: 0;
}

.planner-map-route li span {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #176b9a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.planner-map-route li strong,
.planner-map-route li em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-map-route li em {
  color: #6a7c8d;
  font-style: normal;
}

.planner-map-dialog .planner-day-map-layout {
  grid-template-columns: minmax(520px, 1fr) minmax(280px, 360px);
  min-height: 0;
}

.planner-map-dialog .planner-day-map {
  min-height: min(560px, calc(100vh - 190px));
}

.planner-map-dialog .planner-map-routes {
  max-height: min(560px, calc(100vh - 190px));
}

@media (max-width: 760px) {
  .planner-map-modal {
    padding: 10px;
  }

  .planner-map-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .planner-map-dialog > header div {
    display: grid;
    gap: 2px;
  }

  .planner-map-dialog .planner-day-map-layout {
    grid-template-columns: 1fr;
  }

  .planner-map-dialog .planner-day-map {
    min-height: 360px;
  }

  .planner-map-dialog .planner-map-routes {
    max-height: 300px;
  }
}

.planner-table tbody tr[draggable="true"] {
  cursor: grab;
}

.planner-table tbody tr[draggable="true"]:active {
  cursor: grabbing;
}

.planner-table tr.is-dragging {
  opacity: 0.4;
}

.planner-table tr.is-drop-target td {
  border-top: 3px solid var(--primary, #176b5b);
}

.planner-minute-input {
  width: 50px;
  min-width: 48px;
  min-height: 0;
  height: 24px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  appearance: textfield;
  -moz-appearance: textfield;
  text-align: center;
}

.planner-minute-input::-webkit-outer-spin-button,
.planner-minute-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.planner-minute-input:focus {
  outline: 2px solid var(--primary, #176b5b);
  outline-offset: 1px;
  border-radius: 4px;
}

.planner-admin-note {
  color: #8a5a16;
  font-weight: 700;
}

.planner-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 1558px;
}

.planner-table th,
.planner-table td {
  height: 28px;
  padding: 4px 8px;
  border-right: 1px solid #e1e7ed;
  border-bottom: 1px solid #e1e7ed;
  color: #33475a;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  vertical-align: middle;
}

.planner-table th:first-child,
.planner-table td:first-child {
  border-left: 1px solid #e1e7ed;
}

.planner-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-top: 1px solid #e1e7ed;
  background: linear-gradient(180deg, #ffffff, #f1f4f6);
  color: #2f4050;
  text-align: center;
}

.planner-table td[rowspan] {
  border-right: 1px solid #c4d2e1;
  background: #f8fbff;
}

.planner-table tbody tr:nth-child(even) td:not([rowspan]) {
  background: #f6f8fa;
}

.planner-table tbody tr:hover td:not([rowspan]),
.planner-table tbody tr:focus-visible td:not([rowspan]) {
  background: #f1f8fd;
}

.planner-date,
.planner-weekday {
  display: block;
}

.planner-weekday {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.planner-col-date {
  width: 102px;
}

.planner-col-vehicle {
  width: 66px;
}

.planner-col-order {
  width: 48px;
}

.planner-col-district {
  width: 78px;
}

.planner-col-code {
  width: 82px;
}

.planner-col-site {
  width: 360px;
}

.planner-col-address {
  width: 420px;
}

.planner-col-aps {
  width: 52px;
}

.planner-col-cycle {
  width: 92px;
}

.planner-col-service {
  width: 58px;
}

.planner-col-distance {
  width: 72px;
}

.planner-col-travel {
  width: 58px;
}

.planner-col-departure,
.planner-col-return,
.planner-col-end {
  width: 64px;
}

.planner-col-total {
  width: 70px;
}

.planner-site-cell,
.planner-address-cell,
.planner-code-cell,
.planner-district-cell,
.planner-distance-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-site-cell,
.planner-address-cell {
  text-align: left !important;
}

.planner-route-marker-cell {
  text-align: left !important;
}

.planner-route-marker-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.planner-route-controls,
.planner-route-controls label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.planner-route-controls select {
  width: 270px;
  max-width: 32vw;
  height: 25px;
  padding: 2px 24px 2px 7px;
  border: 1px solid #b8c9d7;
  border-radius: 3px;
  background-color: #fff;
  color: #173d58;
}

.planner-route-delete {
  height: 25px;
  padding: 2px 9px;
  border: 1px solid #d5a5a1;
  border-radius: 3px;
  background: #fff5f4;
  color: #b33f36;
  cursor: pointer;
}

.planner-route-delete:disabled,
.planner-route-controls select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.planner-map-leg-summary {
  color: var(--ok);
  font-weight: 700;
}

.planner-table .planner-order-cell,
.planner-table .planner-aps-cell,
.planner-table .planner-cycle-cell,
.planner-table .planner-service-cell,
.planner-table .planner-travel-cell,
.planner-table .planner-departure-cell,
.planner-table .planner-return-cell,
.planner-table .planner-end-cell,
.planner-table .planner-total-cell {
  text-align: center;
}

.planner-route-summary-cell {
  vertical-align: middle;
  background: #ffffff;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.planner-route-marker-row td {
  background: #ffffff;
  height: 22px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.planner-route-marker-cell {
  text-align: center;
  font-weight: 700;
  color: var(--ink);
}

.planner-route-marker-row .planner-distance-cell,
.planner-route-marker-row .planner-travel-cell {
  text-align: center;
  font-weight: 700;
}

.planner-service-cell,
.planner-travel-cell {
  padding-right: 4px;
  padding-left: 4px;
}

.span-2 {
  grid-column: 1 / -1;
}

.timeline,
.detail-list,
.permission-grid {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.dispatch-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
}

.dispatch-flow div {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
}

.dispatch-flow span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.dispatch-flow strong {
  font-size: 15px;
}

.dispatch-flow em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.timeline-item,
.detail-list div,
.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.timeline-item {
  align-items: flex-start;
  flex-direction: column;
  position: relative;
}

.timeline-item.done {
  border-left: 4px solid var(--ok);
}

.timeline-item.active {
  border-left: 4px solid var(--accent-2);
}

.timeline-item span,
.detail-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.action-button {
  width: 100%;
  min-height: 58px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.action-list.compact button {
  width: 100%;
}

.tool-row {
  padding: 14px 16px 0;
}

.search-input {
  width: 100%;
}

.scan-box {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 22px;
  text-align: center;
}

.scanner-panel,
.signature-panel {
  display: grid;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scanner-head,
.scanner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scanner-actions {
  align-items: stretch;
}

.scanner-video {
  width: 100%;
  min-height: 190px;
  border-radius: 8px;
  background: #172727;
  object-fit: cover;
}

.scanner-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.signature-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.scan-target {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  border: 2px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 30px;
  font-weight: 900;
}

.scan-box p,
.field-card p,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.field-card {
  display: grid;
  gap: 8px;
  margin: 16px 16px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
}

.field-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-card strong {
  font-size: 22px;
}

.permission-grid {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.permission-manager {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.permission-role {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-role summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  cursor: pointer;
  list-style: none;
}

.permission-role summary::-webkit-details-marker {
  display: none;
}

.permission-role summary::before {
  content: "▸";
  color: var(--accent);
  font-weight: 900;
}

.permission-role[open] summary::before {
  content: "▾";
}

.permission-title {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
}

.permission-title em {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  font-style: normal;
}

.permission-save {
  width: auto;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.permission-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.permission-item {
  justify-content: flex-start;
  color: var(--ink);
  font-weight: 800;
}

.permission-item input {
  width: 18px;
  min-height: 18px;
}

.permission-grid-detailed {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.permission-detail {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdfc;
}

.permission-module,
.permission-actions,
.permission-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.permission-module {
  font-weight: 900;
}

.permission-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.empty-state strong {
  font-size: 18px;
}

.photo-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.photo-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}

.photo-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.row-input {
  min-width: 120px;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-actions button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.warn {
  background: #986515;
}

/* Zooy-style operations console skin */
:root {
  --bg: #edf2f6;
  --ink: #34495f;
  --muted: #6d7d8c;
  --line: #cdd7e1;
  --panel: #ffffff;
  --accent: #1378b8;
  --accent-2: #0b9bd1;
  --danger: #d9534f;
  --ok: #5cb85c;
  --shadow: 0 1px 2px rgba(15, 40, 65, .08);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft Yahei UI", "Microsoft JhengHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

.login-view {
  grid-template-columns: minmax(460px, 1fr) 390px;
  background: #e9eff5;
}

.brand-panel {
  position: relative;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 0;
  min-height: 100vh;
  padding: 48px 58px 54px;
  overflow: hidden;
  background: #0e5b91;
  border-right: 1px solid #0d5d95;
}

.login-carousel,
.login-carousel-track,
.login-slide {
  position: absolute;
  inset: 0;
}

.login-carousel {
  z-index: 0;
  overflow: hidden;
}

.login-slide {
  display: grid;
  align-content: end;
  padding: 54px 58px 94px;
  opacity: 0;
  color: #ffffff;
  background-position: center;
  background-size: cover;
  transition: opacity .85s ease;
}

.login-slide.active {
  opacity: 1;
}

.login-slide[data-tone="blue"] {
  background:
    linear-gradient(120deg, rgba(8, 58, 102, .88), rgba(16, 122, 179, .58)),
    radial-gradient(circle at 70% 26%, rgba(255,255,255,.24), transparent 30%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 44px),
    #0f659a;
}

.login-slide[data-tone="teal"] {
  background:
    linear-gradient(120deg, rgba(12, 77, 98, .9), rgba(24, 146, 154, .55)),
    radial-gradient(circle at 74% 30%, rgba(255,255,255,.24), transparent 28%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 48px),
    #116e82;
}

.login-slide[data-tone="steel"] {
  background:
    linear-gradient(120deg, rgba(45, 66, 87, .94), rgba(33, 128, 176, .54)),
    radial-gradient(circle at 76% 24%, rgba(255,255,255,.22), transparent 30%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 1px, transparent 1px 44px),
    #315772;
}

.login-slide h2,
.login-slide p {
  max-width: 620px;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.login-slide h2 {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.18;
}

.login-slide p {
  color: rgba(255,255,255,.88);
  font-size: 15px;
  line-height: 1.8;
}

.login-carousel-dots {
  position: absolute;
  right: 58px;
  bottom: 42px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.login-carousel-dots button {
  width: 26px;
  min-width: 0;
  min-height: 0;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255,255,255,.46);
}

.login-carousel-dots button.active {
  background: #ffffff;
}

.brand-panel > .brand-logo,
.brand-copy {
  position: relative;
  z-index: 2;
}

.brand-copy {
  max-width: 660px;
  margin-top: 24px;
  padding-right: 16px;
}

.brand-panel h1 {
  margin-bottom: 12px;
  font-size: 42px;
  font-weight: 600;
}

.brand-panel p {
  max-width: 720px;
  color: rgba(255,255,255,.86);
  font-size: 15px;
  line-height: 1.85;
}

.brand-logo {
  width: 94px;
  height: 66px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,.15);
}

.login-card {
  margin: 28px;
  padding: 28px 30px;
  border-radius: 3px;
  box-shadow: 0 2px 12px rgba(18, 51, 82, .15);
}

.login-card h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: #4a5662;
  font-size: 22px;
  font-weight: 600;
}

label {
  gap: 6px;
  margin-bottom: 14px;
  color: #5d6b78;
  font-size: 13px;
}

input,
select,
textarea {
  min-height: 34px;
  padding: 6px 9px;
  border-color: #bfcbd6;
  border-radius: 2px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.04);
}

input:focus,
select:focus,
textarea:focus {
  outline: 1px solid #79b9df;
  border-color: #5ba9d5;
}

button {
  min-height: 34px;
  border: 1px solid #0d69a2;
  border-radius: 3px;
  padding: 7px 14px;
  background: linear-gradient(180deg, #1688cc, #0d73b1);
  font-weight: 700;
}

button:hover {
  filter: none;
  background: linear-gradient(180deg, #1b94dc, #0f7dbd);
}

.dashboard-view {
  grid-template-columns: 250px minmax(0, 1fr);
  background: #f4f7f9;
  transition: grid-template-columns .18s ease;
}

.dashboard-view.sidebar-collapsed {
  grid-template-columns: 34px minmax(0, 1fr);
}

.sidebar {
  gap: 0;
  padding: 0;
  background: #edf1f4;
  border-right: 1px solid #bfcbd6;
  color: var(--ink);
  padding-top: 66px;
  overflow: hidden;
  transition: padding .18s ease;
}

.sidebar-brand {
  display: none;
}

.sidebar-brand > div:last-child {
  justify-items: start;
}

.brand-logo.small {
  width: 47px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 2px;
  background: #ffffff;
}

.sidebar-brand strong,
.sidebar-brand span {
  color: #ffffff;
}

.sidebar-brand strong {
  font-size: 15px;
  font-weight: 700;
}

.sidebar-brand span {
  color: rgba(255,255,255,.86);
  font-size: 12px;
}

nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 6px 5px 0;
  background: #edf1f4;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 10px);
  min-height: 31px;
  margin: 0 5px 4px;
  padding: 6px 8px;
  border: 1px solid #bfcbd6;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #e4ebf1);
  color: #33475a;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.nav-toggle:hover {
  background: linear-gradient(180deg, #ffffff, #d9e5ee);
  color: #1f5f8f;
}

.nav-toggle-arrow {
  margin-left: auto;
  font-size: 14px;
}

.sidebar-collapsed .sidebar {
  padding-right: 3px;
  padding-left: 3px;
}

.sidebar-collapsed nav,
.sidebar-collapsed .ghost-button {
  display: none;
}

.sidebar-collapsed .nav-toggle {
  justify-content: center;
  width: 26px;
  min-width: 26px;
  margin-right: auto;
  margin-left: auto;
  padding: 6px 0;
}

.sidebar-collapsed .nav-toggle-label {
  display: none;
}

.sidebar-collapsed .nav-toggle-arrow {
  margin-left: 0;
}

.nav-button,
.ghost-button {
  min-height: 31px;
  margin-bottom: 2px;
  padding: 6px 9px;
  border: 1px solid #c7d0d9;
  border-radius: 0;
  background: linear-gradient(180deg, #fbfcfd, #e9eef3);
  color: #33475a;
  font-size: 13px;
  font-weight: 700;
}

.nav-button.active,
.nav-button:hover {
  border-color: #0798cf;
  background: linear-gradient(180deg, #12a7dc, #0794c9);
  color: #ffffff;
}

.planner-menu.expanded > .nav-button {
  border-color: #0798cf;
  background: linear-gradient(180deg, #12a7dc, #0794c9);
  color: #ffffff;
}

.ghost-button {
  margin: 6px 5px 7px;
  background: linear-gradient(180deg, #ffffff, #e8edf2);
  color: #52606c;
}

.workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 100vh;
  padding: 66px 0 0;
  background: #f4f7f9;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 66px;
  min-height: 66px;
  margin: 0;
  padding: 2px 16px 2px 14px;
  border-bottom: 1px solid #0d6098;
  background: linear-gradient(180deg, #187fc1, #116fae);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 330px;
  min-width: 330px;
  max-width: 330px;
  margin-right: 32px;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 2px 10px;
  border-left: 1px solid rgba(255,255,255,.28);
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

.topbar-account b,
.topbar-account-user {
  color: #ffffff;
  font-weight: 400;
}

.topbar-account-user::before {
  content: "\25cf";
  margin-right: 4px;
  color: #ffcab0;
  font-size: 10px;
}

.topbar-logout-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 2px;
  background: rgba(255,255,255,.12);
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
}

.topbar-logout-button:hover {
  background: rgba(255,255,255,.2);
}

.topbar-brand > div:last-child {
  display: grid;
  gap: 1px;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  justify-items: stretch;
}

.topbar-brand strong {
  display: block;
  width: 100%;
  white-space: nowrap;
  text-align: justify;
  text-align-last: justify;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.15;
}

.topbar-brand span {
  display: block;
  width: 100%;
  white-space: nowrap;
  text-align: justify;
  text-align-last: justify;
  color: rgba(255,255,255,.78);
  font-size: 10px;
  line-height: 1.1;
}

.topbar-page {
  display: none;
}

.topbar-logo {
  width: 66px;
  height: 61px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.topbar p {
  color: rgba(255,255,255,.8);
  font-size: 12px;
}

.topbar h2 {
  margin-top: 2px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
}

.status-stack {
  display: none;
  min-width: 210px;
  padding: 4px 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #ffffff;
  text-align: right;
}

.status-stack strong {
  color: #ffffff;
}

.status-stack b {
  color: #ffffff;
}

.summary-grid,
.content-grid {
  margin-right: 12px;
  margin-left: 12px;
}

.summary-grid {
  display: none;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.content-grid {
  gap: 12px;
  margin-bottom: 14px;
}

.content-grid:has(.site-browser) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 66px);
  margin-right: 0;
  margin-left: 0;
  margin-bottom: 0;
}

.content-grid:has(.planner-table) {
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 66px);
  gap: 0;
  margin-right: 0;
  margin-left: 0;
  margin-bottom: 0;
}

.content-grid:has(.planner-grid-header) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 66px);
  margin: 0;
}

.content-grid:has(.tracking-board) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 66px);
  margin: 0;
}

.dashboard-view:has(.tracking-board) .workspace {
  padding: 66px 0 0;
}

.dashboard-view:has(.tracking-board) .topbar {
  margin-bottom: 0;
}

.content-grid:has(.planner-grid-header) > .panel {
  grid-column: 1 / -1;
  border-radius: 0;
}

.content-grid:has(.planner-table) > .panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.content-grid:has(.site-browser) > .panel {
  grid-column: 1 / -1;
  min-height: 0;
}

.metric,
.panel {
  border-color: #c8d3de;
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 13px 15px;
  background: linear-gradient(180deg, #ffffff, #f9fbfc);
}

.metric span {
  color: #6b7885;
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  margin-top: 5px;
  color: #4e5a66;
  font-size: 24px;
  font-weight: 600;
}

.panel header {
  min-height: 39px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #ffffff, #edf3f7);
  border-bottom-color: #c7d2dd;
}

.panel h3 {
  color: #4f5b66;
  font-size: 15px;
  font-weight: 700;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom-color: #d7e0e8;
  vertical-align: middle;
}

.table th {
  background: #eef4f8;
  color: #536473;
  font-size: 12px;
  font-weight: 700;
}

.table tbody tr:hover td {
  background: #f7fbfd;
}

.tag {
  border-radius: 2px;
  border-color: #a9d6ab;
  background: #e8f5e9;
  color: #2f7d32;
}

.tag.warn {
  border-color: #f0c878;
  background: #fff7e6;
  color: #a86a00;
}

.tag.danger {
  border-color: #e4a4a4;
  background: #fff1f1;
  color: #b73535;
}

.tool-row {
  padding: 10px 12px 0;
}

.form-grid,
.planner-form,
.billing-toolbar,
.billing-status-form,
.proof-form {
  padding: 12px;
  gap: 12px;
}

.planner-summary,
.billing-summary,
.approval-summary,
.proof-summary {
  gap: 10px;
  padding: 12px;
}

.planner-summary div,
.billing-summary div,
.dispatch-flow div,
.timeline-item,
.detail-list div,
.permission-item,
.field-card,
.scanner-panel,
.signature-panel,
.photo-item {
  border-radius: 2px;
  border-color: #cbd6df;
  background: #ffffff;
  box-shadow: none;
}

.planner-note,
.planner-map-toolbar {
  margin: 0 12px 12px;
  border-radius: 2px;
  border-color: #d5c28b;
  background: #fff8df;
}

.planner-map-toolbar {
  background: #ffffff;
  border-color: #cbd6df;
}

.site-table th,
.site-table td {
  padding-top: 4px;
  padding-bottom: 4px;
}

.planner-table th {
  background: linear-gradient(180deg, #ffffff, #f1f4f6);
}

.planner-table td[rowspan] {
  background: #f4f8fb;
}

.planner-minute-input {
  height: 22px;
  border: 0;
  background: transparent;
  appearance: textfield;
  -moz-appearance: textfield;
}

.action-item,
.scan-box,
.empty-state {
  padding: 14px;
}

.action-button,
.table-actions button,
.permission-save,
.planner-map-toolbar button {
  border-radius: 3px;
}

/* 後台表單與清單高度統一：以站點管理清單 28px 為基準 */
.content-grid .table th,
.content-grid .table td,
.content-grid .site-name-table th,
.content-grid .site-name-table td,
.content-grid .planner-table th,
.content-grid .planner-table td,
.content-grid .approval-table th,
.content-grid .approval-table td,
.content-grid .billing-table th,
.content-grid .billing-table td,
.content-grid .audit-table th,
.content-grid .audit-table td {
  height: 28px;
  padding-top: 4px;
  padding-bottom: 4px;
  line-height: 1.25;
  text-align: center;
  vertical-align: middle;
}

.content-grid .site-name-table th,
.content-grid .site-name-table td,
.content-grid .planner-table th,
.content-grid .planner-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.content-grid :is(input:not([type="checkbox"]):not([type="radio"]), select),
.site-modal-dialog :is(input:not([type="checkbox"]):not([type="radio"]), select),
.content-grid .row-input,
.site-modal-dialog .row-input {
  height: 28px;
  min-height: 28px;
  padding: 3px 8px;
  line-height: 1.25;
  font-size: 13px;
}

.content-grid textarea,
.site-modal-dialog textarea {
  min-height: 56px;
  padding: 6px 8px;
  line-height: 1.4;
  font-size: 13px;
}

.content-grid .table-actions button,
.content-grid .row-actions button,
.content-grid .site-tool-button,
.site-modal-dialog header button,
.site-modal-dialog button {
  min-height: 28px;
  padding: 3px 8px;
  line-height: 1.25;
  font-size: 13px;
}

.content-grid .tag {
  min-height: 20px;
  padding: 2px 7px;
  line-height: 1.2;
}

.toast {
  border-radius: 3px;
  background: #2f4050;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}

.topbar-console {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 520px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.topbar-metric {
  display: grid;
  grid-template-columns: 21px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  min-width: 78px;
  color: #ffffff;
  line-height: 1.1;
}

.topbar-metric-icon {
  display: inline-grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 2px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.topbar-metric-icon::before {
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.topbar-metric:nth-child(1) .topbar-metric-icon {
  background: #dd3e3e;
}

.topbar-metric:nth-child(1) .topbar-metric-icon::before {
  content: "\25c9";
}

.topbar-metric:nth-child(2) .topbar-metric-icon {
  background: #8fa0af;
}

.topbar-metric:nth-child(2) .topbar-metric-icon::before {
  content: "\25a3";
}

.topbar-metric:nth-child(3) .topbar-metric-icon {
  background: #f0b42b;
}

.topbar-metric:nth-child(3) .topbar-metric-icon::before {
  content: "\25ce";
}

.topbar-metric:nth-child(4) .topbar-metric-icon {
  background: #dd3e3e;
}

.topbar-metric:nth-child(4) .topbar-metric-icon::before {
  content: "\25b2";
}

.topbar-metric-label {
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 400;
}

.topbar-metric strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
}

.console-badge {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}

.console-badge::before {
  content: "";
  position: absolute;
  left: -7px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255,255,255,.55);
  background: #ffffff;
  transform: rotate(45deg);
}

.console-badge.red {
  background: #dd2f31;
}

.console-badge.gray {
  background: #9aa8b6;
}

.console-badge.amber {
  background: #f2b315;
}

.console-language,
.console-device,
.console-user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.95);
}

.console-language::before {
  content: "▣";
  color: #e83f3f;
}

.console-device::before {
  content: "▥";
  color: #cfefff;
}

.console-user::before {
  content: "◉";
  color: #ffd0d0;
}

nav::before {
  display: none;
  border: 1px solid #bfcbd6;
  background: linear-gradient(180deg, #ffffff, #e4ebf1);
  color: #33475a;
  font-size: 13px;
  font-weight: 700;
}

nav::before {
  content: "▣  導航菜單                                      ≪";
  margin: 0 0 4px;
  padding: 6px 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item {
  display: block;
  margin-bottom: 2px;
}

.nav-item .nav-button {
  margin-bottom: 0;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: #0d7db8;
  font-size: 13px;
  line-height: 1;
}

.nav-button.active .nav-icon,
.nav-button:hover .nav-icon {
  color: #ffffff;
}

.nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-caret {
  margin-left: auto;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  transition: transform .24s cubic-bezier(.22,.61,.36,1);
}

.planner-menu.expanded .nav-caret {
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  gap: 2px;
  max-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-5px);
  padding: 0 4px 0 30px;
  border: 0 solid #c7d0d9;
  border-top: 0;
  background: #eef3f7;
  transition:
    max-height .28s cubic-bezier(.22,.61,.36,1),
    margin-bottom .28s cubic-bezier(.22,.61,.36,1),
    padding .28s cubic-bezier(.22,.61,.36,1),
    opacity .2s ease,
    transform .28s cubic-bezier(.22,.61,.36,1),
    visibility 0s linear .28s;
}

.planner-menu.expanded .nav-submenu {
  max-height: 190px;
  margin-bottom: 8px;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  padding: 4px 4px 5px 30px;
  border-width: 1px;
  border-top: 0;
  transition-delay: 0s;
}

.planner-menu.expanded + .nav-item {
  margin-top: auto;
}

.nav-sub-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #3e5366;
  font-size: 12px;
  text-align: left;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity .18s ease,
    transform .24s cubic-bezier(.22,.61,.36,1),
    background .16s ease,
    border-color .16s ease;
}

.nav-sub-button::before {
  display: inline-grid;
  flex: 0 0 15px;
  place-items: center;
  width: 15px;
  height: 15px;
  color: #1b82bd;
  font-size: 12px;
  line-height: 1;
}

.nav-sub-button[data-planner-action="sites"]::before {
  content: "\25a6";
}

.nav-sub-button[data-planner-action="site-info"]::before {
  content: "\25a7";
}

.nav-sub-button[data-planner-action="branches"]::before {
  content: "\2302";
}

.nav-sub-button[data-planner-action="vehicles"]::before {
  content: "\25a3";
}

.nav-sub-button[data-planner-action="personnel"]::before {
  content: "\25c9";
}

.nav-sub-button[data-planner-action="equipment"]::before {
  content: "\25a7";
}

.nav-sub-button[data-planner-action="aps"]::before {
  content: "\25ce";
}

.nav-sub-button[data-planner-action="generate"]::before {
  content: "\25b6";
}

.nav-sub-button[data-planner-action="dispatch"]::before {
  content: "\25a3";
}

.nav-sub-button[data-planner-action="tasks"]::before {
  content: "\25ce";
}

.nav-sub-button[data-planner-action="export"]::before {
  content: "\25a4";
}

.nav-sub-button[data-planner-action="map"]::before {
  content: "\25ce";
}

.planner-menu.expanded .nav-sub-button {
  opacity: 1;
  transform: translateY(0);
}

.nav-sub-button:hover,
.nav-sub-button.active {
  border-color: #9fc4dc;
  background: linear-gradient(180deg, #ffffff, #dfeaf2);
  color: #0d6fae;
}

.nav-sub-button:hover::before,
.nav-sub-button.active::before {
  color: #0d6fae;
}

.console-welcome {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: center;
  min-height: 186px;
  padding: 18px 16px 18px 24px;
  border-top: 0;
  background: #ffffff;
}

.console-welcome-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.console-welcome h1 {
  margin: 0;
  color: #555f68;
  font-size: 31px;
  font-weight: 600;
}

.console-facts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: #505f6f;
  font-size: 13px;
  font-weight: 700;
}

.console-facts strong {
  margin-left: 3px;
  color: #34495f;
}

.console-welcome p {
  margin: 0;
  color: #d9534f;
  font-size: 13px;
}

.console-welcome em {
  color: #6e7d8c;
  font-style: normal;
}

.console-actions {
  display: grid;
  gap: 15px;
}

.console-actions button {
  min-height: 46px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px;
  color: #ffffff;
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}

.console-actions button::before {
  content: "↳";
  margin-right: 7px;
  font-weight: 900;
}

.console-actions .download {
  border-color: #d45c60;
  background: linear-gradient(180deg, #e6777a, #d75e64);
}

.console-actions .download::before {
  content: "⬇";
}

.console-actions .qr {
  border-color: #e3ad4d;
  background: linear-gradient(180deg, #f4c872, #edb452);
}

.console-actions .qr::before {
  content: "▦";
}

.content-grid:has(.home-console) {
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - 66px);
  margin: 0;
}

.home-console {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 1px solid #cfd7df;
  background: #ffffff;
}

.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 48px 18px 58px;
}

.home-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
  padding-top: 2px;
  text-align: center;
}

.home-copy h1 {
  margin: 0;
  color: #59646f;
  font-size: 32px;
  line-height: 1.25;
  font-weight: 400;
}

.home-facts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 18px;
  color: #4d5c69;
  font-size: 13px;
  line-height: 1.55;
}

.home-facts strong {
  margin-left: 2px;
  color: #334a5e;
  font-weight: 400;
}

.home-inline-action {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ff2f2f;
  font-size: 13px;
}

.home-version {
  color: #4d5c69;
  font-size: 14px;
  font-weight: 400;
}

.home-actions {
  display: grid;
  gap: 16px;
}

.home-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 52px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}

.home-actions button::before {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #ffffff;
  font-size: 16px;
}

.home-actions .start {
  border-color: #62b962;
  background: linear-gradient(180deg, #7acb78, #65bb64);
}

.home-actions .start::before {
  content: "↳";
}

.home-actions .download {
  border-color: #d45c60;
  background: linear-gradient(180deg, #e6777a, #d75e64);
}

.home-actions .download::before {
  content: "↓";
}

.home-actions .qr {
  border-color: #e3ad4d;
  background: linear-gradient(180deg, #f4c872, #edb452);
}

.home-actions .qr::before {
  content: "▦";
}

.home-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 14px 20px;
  border-top: 1px solid #e2e5e8;
  border-bottom: 1px solid #e2e5e8;
  color: #65717d;
}

.home-notice p,
.home-notice span {
  margin: 0;
  font-size: 13px;
}

.home-notice p {
  color: #ff2f2f;
}

.home-notice strong {
  color: #ff2f2f;
  font-size: 26px;
  font-weight: 400;
}

.home-usage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 46px;
  padding: 26px 70px 22px;
  border-top: 1px solid #e2e5e8;
}

.home-usage-card {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  color: #666f79;
  text-align: center;
}

.home-usage-card h3 {
  margin: 0;
  color: #58636d;
  font-size: 21px;
  font-weight: 400;
}

.home-usage-card p {
  margin: 0 0 18px;
  color: #a2aab2;
  font-size: 13px;
}

.home-usage-card.amount-card strong {
  margin-bottom: 14px;
  color: #d94242;
  font-size: 22px;
  font-weight: 400;
}

.home-pie {
  position: relative;
  width: min(16vw, 140px);
  min-width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#e36f70 0 calc(var(--used) * 1%), #6aa6d8 0 100%);
}

.home-pie-label {
  position: absolute;
  color: #4a96dc;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  body.guard-mobile-mode .dashboard-view {
    grid-template-columns: 1fr;
  }

  body.guard-mobile-mode .sidebar,
  body.guard-mobile-mode .topbar,
  body.guard-mobile-mode .summary-grid {
    display: none;
  }

  body.guard-mobile-mode .workspace {
    min-width: 0;
    padding: 0;
  }

  body.guard-mobile-mode .content-grid {
    display: block;
    padding: 0;
  }

  .guard-mobile-shell {
    max-width: none;
    padding: 8px;
  }

  .guard-mobile-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .guard-mobile-hero h2 {
    font-size: 32px;
  }

  .guard-mobile-metrics {
    width: 100%;
  }

  .guard-proof-strip,
  .guard-big-actions,
  .guard-collection-form,
  .guard-form-buttons {
    grid-template-columns: 1fr;
  }

  .guard-big-button {
    min-height: 96px;
  }

  .guard-big-button strong {
    font-size: 22px;
  }

  .guard-current-stop h3 {
    font-size: 30px;
  }
}

.home-pie-label.used {
  right: -35px;
  bottom: 7px;
  color: #e36f70;
}

.home-pie-label.unused {
  top: -13px;
  left: -30px;
}

@media (max-width: 920px) {
  .topbar-console {
    justify-content: flex-start;
    min-width: 0;
    flex-wrap: wrap;
    white-space: normal;
  }

  .console-welcome {
    grid-template-columns: 1fr;
  }

  .login-view {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 420px;
    padding: 32px 24px 88px;
  }

  .login-slide {
    padding: 48px 24px 74px;
  }

  .login-slide h2 {
    font-size: 27px;
  }

  .login-carousel-dots {
    right: 24px;
    bottom: 30px;
  }

  .login-card {
    margin: 20px;
  }

  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .dashboard-view.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    gap: 12px;
    height: auto;
  }

  .sidebar-collapsed .sidebar {
    height: 38px;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }

  .ghost-button {
    margin-top: 0;
  }

  .workspace {
    padding: 18px;
  }

  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .site-browser {
    grid-template-columns: 1fr;
  }

  .site-tree-panel {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .form-grid,
  .permission-grid,
  .planner-form,
  .planner-summary,
  .approval-summary,
  .billing-summary,
  .billing-status-form,
  .proof-form,
  .dispatch-flow,
  .dispatch-create-grid,
  .dispatch-card-grid,
  .dispatch-card-grid.compact {
    grid-template-columns: 1fr;
  }

  .billing-note,
  .proof-note {
    grid-column: auto;
  }

  .proof-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .action-item,
  .timeline-item,
  .detail-list div,
  .scanner-head,
  .scanner-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-toolbar input {
    width: 100%;
  }

  .status-stack {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .brand-panel {
    align-items: flex-start;
    flex-direction: column;
    min-height: 390px;
    padding: 24px 18px 78px;
  }

  .brand-panel h1 {
    font-size: 30px;
  }

  .brand-panel p,
  .login-slide p {
    font-size: 13px;
  }

  .login-slide {
    padding: 42px 18px 68px;
  }

  .login-slide h2 {
    font-size: 22px;
  }

  nav,
  .field-actions {
    grid-template-columns: 1fr;
  }

  .permission-detail {
    grid-template-columns: 1fr;
  }

  .permission-actions {
    justify-content: flex-start;
  }

  .table th:nth-child(3),
  .table td:nth-child(3) {
    display: none;
  }
}

/* Typography preference: keep all interface text regular weight. */
body,
body *,
button,
input,
select,
textarea,
strong,
b,
th,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400 !important;
}

/* Rollback skin disabled so the Zooy style can apply again.
:root {
  --bg: #f3f6fb;
  --ink: #10243f;
  --muted: #5f718a;
  --line: #d8e2ee;
  --panel: #ffffff;
  --accent: #0b4f8f;
  --accent-2: #1f7acb;
  --danger: #b73535;
  --ok: #21865a;
  --shadow: 0 18px 45px rgba(16, 36, 63, .12);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
  font-size: initial;
}

body *,
button,
input,
select,
textarea,
strong,
b,
th,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: revert !important;
}

.login-carousel,
.topbar-console,
.console-welcome,
nav::before,
.nav-icon,
.nav-caret,
.nav-submenu {
  display: none !important;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 420px;
  min-height: 100vh;
  background: transparent;
}

.brand-panel {
  display: flex;
  position: static;
  align-items: flex-start;
  flex-direction: row;
  gap: 28px;
  min-height: auto;
  padding: 8vw;
  overflow: visible;
  border-right: 0;
  background:
    linear-gradient(135deg, rgba(11, 47, 91, .95), rgba(7, 22, 43, .96)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255,255,255,.08) 42px 43px);
  color: #fff;
}

.brand-panel > .brand-logo,
.brand-copy {
  position: static;
  z-index: auto;
}

.brand-copy {
  max-width: none;
  margin-top: 0;
  padding-right: 0;
}

.brand-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: 0;
}

.brand-panel p {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 18px;
  line-height: 1.8;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 112px;
  height: 76px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.66);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.brand-logo.small {
  width: 82px;
  height: 60px;
  border: 0;
  background: transparent;
}

.login-card {
  align-self: center;
  margin: 32px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 26px;
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--ink);
  font-size: 25px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700 !important;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-2);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800 !important;
  cursor: pointer;
}

button:hover {
  filter: brightness(.96);
  background: var(--accent);
}

.dashboard-view {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 22px;
  border-right: 0;
  background: linear-gradient(180deg, #071b34 0%, #0b2f5b 100%);
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 86px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #2f3742;
  text-align: center;
}

.sidebar-brand > div:last-child {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.sidebar-brand strong {
  color: #2f3742;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700 !important;
}

.sidebar-brand span {
  display: block;
  margin-top: 0;
  color: #4b5563;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding: 0 0 8px;
  background: transparent;
}

.nav-item {
  display: block;
  margin-bottom: 0;
}

.nav-button,
.ghost-button {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-bottom: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,.76);
  text-align: left;
}

.nav-button.active,
.nav-button:hover {
  border-color: transparent;
  background: rgba(31, 122, 203, .28);
  color: #fff;
}

.nav-text {
  display: inline;
  overflow: visible;
  text-overflow: clip;
}

.ghost-button {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.22);
  flex: 0 0 auto;
  background: rgba(255,255,255,.08);
}

.workspace {
  padding: 28px;
  overflow: auto;
  background: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: auto;
  margin: 0 0 24px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--ink);
}

.topbar p,
.topbar h2 {
  margin: 0;
}

.topbar p {
  color: var(--muted);
  font-size: initial;
  font-weight: 700 !important;
}

.topbar h2 {
  margin-top: 6px;
  color: var(--ink);
  font-size: 30px;
}

.status-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.status-stack strong {
  color: var(--ink);
  font-weight: 700 !important;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 18px;
  margin: 0;
}

.metric,
.panel {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800 !important;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700 !important;
}

.panel header {
  min-height: auto;
  padding: 16px 18px;
  background: transparent;
}

.panel h3,
.panel h4,
.settings-section h4 {
  font-weight: 700 !important;
}

th,
strong,
b {
  font-weight: 700 !important;
}

@media (max-width: 920px) {
  .login-view,
  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
    padding: 38px 24px;
  }

  .login-card {
    margin: 20px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    gap: 12px;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }

  .workspace {
    padding: 18px;
  }

  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status-stack {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .brand-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    grid-template-columns: 1fr;
  }
}
*/

/* AI inspection style login page */
.login-view {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 52px minmax(560px, 1fr) 92px;
  min-height: 100vh;
  background: #ffffff;
  color: #1c2a36;
  font-family: "Microsoft Yahei UI", "Microsoft JhengHei", "Segoe UI", Arial, sans-serif;
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
  background: #262626;
  color: #bfc5c9;
  font-size: 18px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
}

.login-topbar-title {
  color: #ffffff;
  font-size: 24px;
  letter-spacing: 1px;
  font-weight: 700 !important;
}

.login-language {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #bfc5c9 !important;
  font-size: 13px;
  font-weight: 400 !important;
}

.login-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 302px;
  align-items: start;
  gap: 48px;
  min-height: 560px;
  padding: 62px 38px 48px;
  overflow: hidden;
  background: #f7ad36;
}

.login-stage::before {
  content: "";
  position: absolute;
  right: -60px;
  bottom: 0;
  left: -80px;
  height: 94px;
  background:
    radial-gradient(circle at 7% 48%, #fff 0 56px, transparent 57px),
    radial-gradient(circle at 14% 52%, #fff 0 48px, transparent 49px),
    radial-gradient(circle at 45% 58%, #fff 0 54px, transparent 55px),
    radial-gradient(circle at 55% 72%, #fff 0 50px, transparent 51px),
    radial-gradient(circle at 72% 42%, #fff 0 58px, transparent 59px),
    radial-gradient(circle at 82% 40%, #fff 0 74px, transparent 75px),
    radial-gradient(circle at 93% 52%, #fff 0 52px, transparent 53px),
    linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-size:
    180px 95px,
    170px 88px,
    220px 92px,
    210px 90px,
    190px 92px,
    240px 96px,
    190px 92px,
    100% 44px;
  background-position:
    0 18px,
    105px 24px,
    850px 28px,
    1040px 46px,
    1280px 30px,
    1410px 20px,
    1660px 30px,
    0 70px;
}

.login-stage::after {
  content: "";
  position: absolute;
  bottom: 28px;
  left: 49%;
  width: 10px;
  height: 10px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  box-shadow: 16px 0 0 -1px #ffffff, 32px 0 0 -1px #ffffff;
  opacity: .95;
}

.login-stage .brand-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(560px, 760px) minmax(330px, 520px);
  align-items: center;
  gap: 42px;
  width: min(1260px, 100%);
  min-height: 470px;
  padding: 0 0 0 90px;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #ffffff;
}

.login-stage .login-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none !important;
  overflow: hidden;
  background: #f7ad36;
}

.login-view.has-login-backgrounds .login-stage .login-carousel {
  display: block !important;
}

.login-stage .login-carousel-track,
.login-stage .login-slide {
  position: absolute;
  inset: 0;
}

.login-stage .login-slide {
  display: block;
  padding: 0;
  opacity: 1;
  background-position: center;
  background-size: cover;
  transform: translateX(100%);
  transition: transform .75s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
  z-index: 0;
}

.login-stage .login-slide.active {
  transform: translateX(0);
  z-index: 2;
}

.login-stage .login-slide.was-active {
  transform: translateX(-100%);
  z-index: 1;
}

.login-stage .login-slide h2,
.login-stage .login-slide p {
  display: none;
}

.login-stage .login-carousel-dots {
  position: absolute;
  right: auto;
  bottom: 32px;
  left: 50%;
  z-index: 5;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.login-stage .login-carousel-dots button {
  width: 10px;
  height: 10px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #ffffff;
  border-radius: 50%;
  background: transparent;
}

.login-stage .login-carousel-dots button.active {
  background: #ffffff;
}

.login-view.has-login-backgrounds .login-stage::before,
.login-view.has-login-backgrounds .login-stage::after,
.login-view.has-login-backgrounds .login-illustration,
.login-view.has-login-backgrounds .brand-copy {
  display: none;
}

.login-view.has-login-backgrounds .login-stage {
  background: #f7ad36;
}

.login-view.has-login-backgrounds .login-stage .brand-panel {
  visibility: hidden;
}

.login-illustration {
  position: relative;
  min-height: 470px;
}

.illustration-cloud {
  position: absolute;
  top: 92px;
  width: 92px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.08));
}

.illustration-cloud::before,
.illustration-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: #ffffff;
}

.illustration-cloud::before {
  left: 10px;
  width: 36px;
  height: 36px;
}

.illustration-cloud::after {
  right: 10px;
  width: 52px;
  height: 52px;
}

.cloud-one {
  left: 300px;
}

.cloud-two {
  top: 96px;
  left: 500px;
  width: 58px;
  height: 22px;
}

.cloud-two::before {
  width: 24px;
  height: 24px;
}

.cloud-two::after {
  width: 32px;
  height: 32px;
}

.illustration-card {
  position: absolute;
  display: grid;
  place-items: center;
  width: 118px;
  height: 88px;
  border: 10px solid #ffffff;
  border-radius: 50%;
  background: #eaf6ff;
  color: #1789c8;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
}

.card-left {
  top: 102px;
  left: 64px;
  transform: rotate(-12deg);
}

.card-right {
  top: 104px;
  right: 22px;
  transform: rotate(16deg);
}

.illustration-desk {
  position: absolute;
  top: 190px;
  left: 268px;
  width: 220px;
  height: 132px;
}

.illustration-desk::before {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 10px;
  left: 18px;
  height: 58px;
  border: 5px solid #ffffff;
  border-top: 12px solid #ffffff;
  background: linear-gradient(90deg, #f79f24 0 50%, #f2f2f2 50% 100%);
  box-shadow: inset -48px 0 0 #eeeeee;
}

.illustration-desk span {
  position: absolute;
  top: 0;
  left: 54px;
  width: 120px;
  height: 70px;
  border: 5px solid #253545;
  background:
    linear-gradient(90deg, #f36b21 0 26px, transparent 26px),
    linear-gradient(180deg, transparent 0 38px, #2c8cca 38px 44px, transparent 44px),
    linear-gradient(90deg, #58b7db 0 20%, #ffffff 20% 100%);
  box-shadow: inset 0 -8px 0 #e4e8eb;
}

.illustration-desk strong {
  position: absolute;
  top: 56px;
  left: 92px;
  width: 36px;
  height: 88px;
  border-radius: 18px 18px 4px 4px;
  background: #154b70;
}

.illustration-desk strong::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4a2b17;
}

.illustration-earth {
  position: absolute;
  right: -40px;
  bottom: -210px;
  left: -34px;
  height: 300px;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(circle at 18% 46%, #f7f8ec 0 24px, transparent 25px),
    radial-gradient(circle at 72% 36%, #f7f8ec 0 36px, transparent 37px),
    radial-gradient(circle at 42% 18%, #f7f8ec 0 38px, transparent 39px),
    linear-gradient(150deg, #58d6ef 0 28%, #39b7ee 28% 58%, #259bdc 58% 100%);
  box-shadow: inset 0 18px 0 rgba(255,255,255,.35);
}

.pin {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid #e22625;
  border-radius: 50% 50% 50% 0;
  background: #ffffff;
  transform: rotate(-45deg);
}

.pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #252525;
}

.pin-one {
  top: 34px;
  left: 360px;
}

.pin-two {
  top: 98px;
  left: 482px;
}

.pin-three {
  top: 132px;
  left: 70px;
  border-color: #1fae88;
}

.login-stage .brand-copy {
  align-self: center;
  max-width: 520px;
  margin: 0;
  padding: 0;
  color: #ffffff;
}

.login-stage .brand-copy h1,
.login-stage .brand-copy h2 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 2px;
  font-weight: 700 !important;
}

.login-stage .brand-copy h2 {
  margin-top: 8px;
}

.login-stage .brand-copy p {
  max-width: 520px;
  margin: 0 0 7px;
  color: #ffffff;
  font-size: 21px;
  line-height: 1.55;
  letter-spacing: 1px;
  font-weight: 600 !important;
}

.login-stage .brand-copy span {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 12px 3px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 6px;
  background: #f7f7f7;
  color: #2498df;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 2px;
  font-weight: 800 !important;
}

.login-stage .login-card {
  position: relative;
  z-index: 2;
  align-self: start;
  width: 302px;
  margin: 0;
  margin-top: 0;
  padding: 0 10px 58px;
  border: 0;
  border-radius: 2px;
  background: #2b1b05;
  box-shadow: 0 1px 12px rgba(0,0,0,.45);
}

.login-stage .login-card h2 {
  display: grid;
  place-items: center;
  min-height: 68px;
  margin: 0 -10px 22px;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,.35);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  text-align: center;
  font-weight: 700 !important;
}

.login-stage .login-card label {
  gap: 7px;
  margin: 0 0 15px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700 !important;
}

.login-stage .login-card input,
.login-stage .login-card select {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d7d7d7;
  border-radius: 0;
  background: #f5f5f5;
  color: #4a4a4a;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.1);
}

.login-role-field {
  display: none !important;
}

.login-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 19px 10px 24px;
  font-size: 14px;
}

.login-links a,
.login-footer a {
  color: #1589c8;
  text-decoration: none;
}

.login-links a:hover,
.login-footer a:hover {
  text-decoration: underline;
}

.login-stage .login-card button[type="submit"] {
  width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  background: #337fb9;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700 !important;
}

.login-stage .login-card .hint {
  display: none;
}

.login-error-message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f0b8b8;
  background: #fff1f1;
  color: #b42318;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700 !important;
}

.login-footer {
  display: flex;
  align-items: flex-start;
  min-height: 92px;
  padding: 2px 20px 0;
  border-top: 1px solid #ebebeb;
  background: #ffffff;
  color: #1a1a1a;
  font-family: "PMingLiU", "MingLiU", "細明體", serif;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 400 !important;
}

@media (max-width: 1180px) {
  .login-stage {
    grid-template-columns: 1fr;
    padding: 38px 24px 110px;
  }

  .login-stage .brand-panel {
    grid-template-columns: 1fr;
    min-height: 390px;
    padding-left: 0;
  }

  .login-stage .brand-copy {
    display: none;
  }

  .login-stage .login-card {
    justify-self: end;
  }
}

@media (max-width: 680px) {
  .login-view {
    grid-template-rows: 52px minmax(650px, 1fr) auto;
  }

  .login-topbar {
    padding-right: 14px;
    font-size: 15px;
  }

  .login-stage {
    justify-items: center;
    padding: 28px 16px 92px;
  }

  .login-stage .brand-panel {
    display: none;
  }

  .login-stage .login-card {
    justify-self: center;
    margin-top: 32px;
  }

  .login-footer {
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 18px 12px;
  }
}

body.app-booting {
  background: #f3f6fb;
}

body.app-booting .login-view,
body.app-booting .dashboard-view {
  visibility: hidden;
}

body.app-booting::before,
body.app-booting::after {
  content: "";
  position: fixed;
  z-index: 9999;
  pointer-events: none;
}

body.app-booting::before {
  inset: 0;
  background: #f3f6fb;
}

body.app-booting::after {
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid #c9d6e5;
  border-top-color: #1f7acb;
  border-radius: 50%;
  animation: appBootSpin .8s linear infinite;
}

@keyframes appBootSpin {
  to { transform: rotate(360deg); }
}

/* 最終覆蓋：修正後段舊 sidebar 樣式覆蓋導致收合無效 */
.dashboard-view.sidebar-collapsed,
body.sidebar-collapsed .dashboard-view,
html.sidebar-collapsed .dashboard-view {
  grid-template-columns: 34px minmax(0, 1fr) !important;
}

.dashboard-view.sidebar-collapsed .sidebar,
body.sidebar-collapsed .dashboard-view .sidebar,
html.sidebar-collapsed .dashboard-view .sidebar {
  gap: 0 !important;
  width: 34px;
  min-width: 34px;
  padding: 66px 3px 0 !important;
  overflow: hidden;
}

.dashboard-view.sidebar-collapsed .sidebar-brand,
.dashboard-view.sidebar-collapsed nav,
.dashboard-view.sidebar-collapsed .ghost-button,
body.sidebar-collapsed .dashboard-view .sidebar-brand,
body.sidebar-collapsed .dashboard-view nav,
body.sidebar-collapsed .dashboard-view .ghost-button,
html.sidebar-collapsed .dashboard-view .sidebar-brand,
html.sidebar-collapsed .dashboard-view nav,
html.sidebar-collapsed .dashboard-view .ghost-button {
  display: none !important;
}

.dashboard-view.sidebar-collapsed .nav-toggle,
body.sidebar-collapsed .dashboard-view .nav-toggle,
html.sidebar-collapsed .dashboard-view .nav-toggle {
  display: flex !important;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  margin: 0 auto 4px;
  padding: 6px 0;
}

.dashboard-view.sidebar-collapsed .nav-toggle-label,
body.sidebar-collapsed .dashboard-view .nav-toggle-label,
html.sidebar-collapsed .dashboard-view .nav-toggle-label {
  display: none !important;
}

.dashboard-view.sidebar-collapsed .nav-toggle-arrow,
body.sidebar-collapsed .dashboard-view .nav-toggle-arrow,
html.sidebar-collapsed .dashboard-view .nav-toggle-arrow {
  margin-left: 0;
}

/* 手機保全員端最終覆蓋：避免桌機版側欄/收合樣式把畫面推出 iPhone 螢幕 */
@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.guard-mobile-mode .dashboard-view,
  body.guard-mobile-mode.sidebar-collapsed .dashboard-view,
  html.sidebar-collapsed body.guard-mobile-mode .dashboard-view,
  html.sidebar-collapsed .dashboard-view:has(.guard-mobile-shell) {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    background: #f3f6fb !important;
  }

  body.guard-mobile-mode .sidebar,
  body.guard-mobile-mode .topbar,
  body.guard-mobile-mode .summary-grid,
  body.guard-mobile-mode.sidebar-collapsed .sidebar,
  html.sidebar-collapsed body.guard-mobile-mode .sidebar {
    display: none !important;
  }

  body.guard-mobile-mode .workspace {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  body.guard-mobile-mode .content-grid {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  body.guard-mobile-mode .guard-mobile-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-x: hidden !important;
  }

  body.guard-mobile-mode .guard-mobile-hero,
  body.guard-mobile-mode .guard-current-stop,
  body.guard-mobile-mode .guard-collection-card,
  body.guard-mobile-mode .guard-stop-list,
  body.guard-mobile-mode .guard-proof-form,
  body.guard-mobile-mode .guard-mobile-routes {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* 手機登入頁保底：未登入時一定看得到登入表單 */
@media (max-width: 820px) {
body:not(.guard-mobile-mode) .login-view:not(.hidden) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 100svh !important;
    overflow-x: hidden !important;
    background: #f3f6fb !important;
  }

  body:not(.guard-mobile-mode) .login-stage {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 20px 14px 28px !important;
  }

  body:not(.guard-mobile-mode) .login-stage .brand-panel,
  body:not(.guard-mobile-mode) .login-carousel {
    display: none !important;
  }

body:not(.guard-mobile-mode) .login-stage .login-card {
    display: grid !important;
    width: min(100%, 340px) !important;
    max-width: calc(100vw - 28px) !important;
    margin: 0 auto !important;
    transform: none !important;
  }
}

/* 桌機 / 筆電解析度自適應：保留所有欄位，依螢幕寬度等比例壓縮表格與側欄 */
@media (min-width: 821px) {
  html {
    --desktop-sidebar-width: 250px;
    --desktop-tree-width: 320px;
    --desktop-workspace-pad: 0px;
    --desktop-panel-gap: 8px;
    --desktop-table-font: 13px;
    --desktop-table-pad-x: 7px;
    --desktop-table-pad-y: 3px;
    --desktop-row-height: 27px;
    --desktop-control-height: 27px;
  }

  body:not(.guard-mobile-mode) .dashboard-view {
    grid-template-columns: var(--desktop-sidebar-width) minmax(0, 1fr);
  }

  body:not(.guard-mobile-mode) .workspace {
    min-width: 0;
    padding: 66px 0 0;
    gap: var(--desktop-panel-gap);
  }

  body:not(.guard-mobile-mode) .content-grid,
  body:not(.guard-mobile-mode) .panel,
  body:not(.guard-mobile-mode) .site-browser-panel,
  body:not(.guard-mobile-mode) .site-grid,
  body:not(.guard-mobile-mode) .site-grid-table {
    min-width: 0;
    max-width: 100%;
  }

  body:not(.guard-mobile-mode) .site-browser,
  body:not(.guard-mobile-mode) .cashroom-layout,
  body:not(.guard-mobile-mode) .dispatch-browser {
    grid-template-columns: minmax(170px, var(--desktop-tree-width)) minmax(0, 1fr);
  }

  body:not(.guard-mobile-mode) .site-name-table,
  body:not(.guard-mobile-mode) .branch-name-table,
  body:not(.guard-mobile-mode) .vehicle-name-table,
  body:not(.guard-mobile-mode) .personnel-table,
  body:not(.guard-mobile-mode) .equipment-name-table,
  body:not(.guard-mobile-mode) .aps-name-table,
  body:not(.guard-mobile-mode) .cashroom-name-table,
  body:not(.guard-mobile-mode) .dispatch-name-table,
  body:not(.guard-mobile-mode) .dispatch-task-table,
  body:not(.guard-mobile-mode) .dispatch-route-select-table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  body:not(.guard-mobile-mode) .content-grid .site-name-table th,
  body:not(.guard-mobile-mode) .content-grid .site-name-table td,
  body:not(.guard-mobile-mode) .content-grid .planner-table th,
  body:not(.guard-mobile-mode) .content-grid .planner-table td,
  body:not(.guard-mobile-mode) .content-grid .table th,
  body:not(.guard-mobile-mode) .content-grid .table td {
    height: var(--desktop-row-height) !important;
    min-height: var(--desktop-row-height) !important;
    padding: var(--desktop-table-pad-y) var(--desktop-table-pad-x) !important;
    font-size: var(--desktop-table-font) !important;
    line-height: 1.25 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.guard-mobile-mode) .content-grid .site-name-table th,
  body:not(.guard-mobile-mode) .content-grid .planner-table th,
  body:not(.guard-mobile-mode) .content-grid .table th {
    font-weight: 500;
  }

  body:not(.guard-mobile-mode) .content-grid .site-name-table td:nth-child(5) {
    text-align: left !important;
  }

  body:not(.guard-mobile-mode) .site-tool-button,
  body:not(.guard-mobile-mode) .site-grid-filter input,
  body:not(.guard-mobile-mode) .site-grid-filter select,
  body:not(.guard-mobile-mode) .site-grid-toolbar input,
  body:not(.guard-mobile-mode) .site-grid-toolbar select,
  body:not(.guard-mobile-mode) .planner-toolbar input,
  body:not(.guard-mobile-mode) .planner-toolbar select,
  body:not(.guard-mobile-mode) .planner-toolbar button,
  body:not(.guard-mobile-mode) .dispatch-filter input,
  body:not(.guard-mobile-mode) .dispatch-filter select {
    min-height: var(--desktop-control-height) !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: var(--desktop-table-font) !important;
  }

  body:not(.guard-mobile-mode) .site-tree-panel,
  body:not(.guard-mobile-mode) .tree-item,
  body:not(.guard-mobile-mode) .nav-button,
  body:not(.guard-mobile-mode) .nav-group-header {
    font-size: var(--desktop-table-font);
  }
}

/* 工具列與品牌區不可像資料格一樣壓縮，避免按鈕文字被擠在一起 */
@media (min-width: 821px) {
  body:not(.guard-mobile-mode) .topbar {
    height: 66px !important;
    min-height: 66px !important;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
  }

  body:not(.guard-mobile-mode) .topbar-brand {
    flex: 0 0 330px;
    min-width: 330px;
    max-width: 330px;
    margin-right: 32px;
    overflow: hidden;
  }

  body:not(.guard-mobile-mode) .topbar-brand strong,
  body:not(.guard-mobile-mode) .topbar-brand span {
    width: 100%;
    text-align: justify;
    text-align-last: justify;
    overflow: visible;
    text-overflow: clip;
  }

  body:not(.guard-mobile-mode) .site-grid-toolbar,
  body:not(.guard-mobile-mode) .planner-toolbar {
    min-height: 32px;
    gap: 6px 10px !important;
    align-items: center;
    overflow: visible;
  }

  body:not(.guard-mobile-mode) .site-tool-button,
  body:not(.guard-mobile-mode) .planner-toolbar button {
    flex: 0 0 auto;
    width: auto !important;
    min-width: max-content;
    min-height: 28px !important;
    height: auto !important;
    padding: 3px 7px !important;
    line-height: 1.35 !important;
    white-space: nowrap !important;
    font-size: 13px !important;
  }

  body:not(.guard-mobile-mode) .site-grid-toolbar .site-tool-icon {
    flex: 0 0 auto;
  }
}

@media (min-width: 821px) and (max-width: 1600px) {
  html {
    --desktop-sidebar-width: 230px;
    --desktop-tree-width: 285px;
    --desktop-workspace-pad: 0px;
    --desktop-panel-gap: 6px;
    --desktop-table-font: 12px;
    --desktop-table-pad-x: 5px;
    --desktop-table-pad-y: 2px;
    --desktop-row-height: 24px;
    --desktop-control-height: 26px;
  }

  body:not(.guard-mobile-mode) .topbar {
    min-height: 66px;
  }

  body:not(.guard-mobile-mode) .sidebar {
    padding-left: 5px;
    padding-right: 5px;
  }
}

@media (min-width: 821px) and (max-width: 1440px) {
  html {
    --desktop-sidebar-width: 214px;
    --desktop-tree-width: 255px;
    --desktop-workspace-pad: 0px;
    --desktop-table-font: 11.5px;
    --desktop-table-pad-x: 4px;
    --desktop-row-height: 23px;
    --desktop-control-height: 26px;
  }

  body:not(.guard-mobile-mode) .sidebar-brand {
    padding: 10px 8px;
  }

  body:not(.guard-mobile-mode) .nav-button,
  body:not(.guard-mobile-mode) .nav-sub-button {
    padding-left: 8px;
    padding-right: 8px;
  }
}

@media (min-width: 821px) and (max-width: 1366px) {
  html {
    --desktop-sidebar-width: 198px;
    --desktop-tree-width: 230px;
    --desktop-workspace-pad: 0px;
    --desktop-panel-gap: 4px;
    --desktop-table-font: 11px;
    --desktop-table-pad-x: 3px;
    --desktop-table-pad-y: 1px;
    --desktop-row-height: 22px;
    --desktop-control-height: 26px;
  }

  body:not(.guard-mobile-mode) .brand-name {
    font-size: 13px;
  }

  body:not(.guard-mobile-mode) .brand-subtitle {
    font-size: 9px;
  }

  body:not(.guard-mobile-mode) .topbar {
    min-height: 66px;
    padding-left: 8px;
    padding-right: 8px;
  }
}

@media (min-width: 821px) and (max-width: 1280px) {
  html {
    --desktop-sidebar-width: 184px;
    --desktop-tree-width: 210px;
    --desktop-table-font: 10.5px;
    --desktop-table-pad-x: 2px;
    --desktop-row-height: 21px;
    --desktop-control-height: 26px;
  }

  body:not(.guard-mobile-mode) .sidebar-brand img {
    width: 38px;
    height: 38px;
  }

  body:not(.guard-mobile-mode) .site-grid-toolbar,
body:not(.guard-mobile-mode) .planner-toolbar {
    gap: 4px;
  }
}

/* 整鈔中心最終欄寬覆蓋：必須位於舊版站點表格規則之後。 */
body:not(.guard-mobile-mode) .cashroom-name-table th,
body:not(.guard-mobile-mode) .cashroom-name-table td {
  padding-right: 6px !important;
  padding-left: 6px !important;
}

body:not(.guard-mobile-mode) .cashroom-name-table :is(th, td):first-child {
  width: 4% !important;
  text-align: center !important;
}

body:not(.guard-mobile-mode) .cashroom-name-table td {
  text-align: left !important;
}

body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(2) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(3) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(4) { width: 18% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(6) { width: 10% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(7) { width: 12% !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(8),
body:not(.guard-mobile-mode) .cashroom-receive-table :is(th, td):nth-child(9) { width: 8% !important; text-align: center !important; }

body:not(.guard-mobile-mode) .cashroom-count-table { min-width: 800px !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(2) { width: 16% !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(3) { width: 20% !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(4) { width: 14% !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(6) { width: 12% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(7) { width: 10% !important; text-align: center !important; }
body:not(.guard-mobile-mode) .cashroom-count-table :is(th, td):nth-child(8) { width: 12% !important; text-align: center !important; }

body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(2) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(3) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(4) { width: 8% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(5) { width: 9% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(6) { width: 11% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(7) { width: 14% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(8) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-fund-table :is(th, td):nth-child(9) { width: 19% !important; }

body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(2) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(3) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(4) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(5) { width: 12% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(6) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(7),
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(8) { width: 7% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(9),
body:not(.guard-mobile-mode) .cashroom-float-movement-table :is(th, td):nth-child(10) { width: 10% !important; }

body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(2) { width: 15% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(3) { width: 16% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(4) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(6) { width: 11% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(7) { width: 10% !important; text-align: center !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(8) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-diff-table :is(th, td):nth-child(9) { width: 10% !important; text-align: center !important; }

body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(2) { width: 13% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(3) { width: 14% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(4) { width: 18% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(6),
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(7) { width: 10% !important; text-align: right !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(8) { width: 10% !important; }
body:not(.guard-mobile-mode) .cashroom-report-table :is(th, td):nth-child(9) { width: 11% !important; }

/* 表格工具列下拉選單：保留完整文字，並以 CSS 箭頭取代容易重疊的原生箭頭。 */
body:not(.guard-mobile-mode) .site-grid-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px !important;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #41637a 50%),
    linear-gradient(135deg, #41637a 50%, transparent 50%);
  background-position:
    calc(100% - 11px) 50%,
    calc(100% - 7px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

body:not(.guard-mobile-mode) .site-grid-toolbar .site-grid-filter select,
body:not(.guard-mobile-mode) select[data-dispatch-status-filter] {
  width: 92px !important;
  min-width: 92px !important;
}

/* Login page final overrides: keep this block last so legacy themes cannot win. */
.login-view {
  grid-template-columns: 1fr;
  grid-template-rows: 64px minmax(560px, 1fr) 48px;
  background: #030b16;
  color: #eaf7ff;
}

.login-topbar {
  position: relative;
  z-index: 10;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(79, 215, 255, .28);
  background: linear-gradient(90deg, #06111f, #0a1c2e 52%, #06111f);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .28);
}

.login-topbar-title {
  color: #f4fbff;
  font-size: 23px;
  letter-spacing: .08em;
  text-shadow: 0 0 18px rgba(69, 205, 255, .42);
}

.login-stage {
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: center;
  gap: 42px;
  min-height: 560px;
  padding: 54px clamp(32px, 5vw, 96px);
  overflow: hidden;
  background-color: #061321;
  background-image:
    linear-gradient(90deg, rgba(2, 9, 18, .04), rgba(2, 9, 18, .02) 47%, rgba(2, 9, 18, .38) 72%, rgba(2, 9, 18, .78)),
    url("assets/login/sci-fi-security-hero.png");
  background-position: center, left center;
  background-repeat: no-repeat;
  background-size: 100% 100%, auto 105%;
}

.login-scene-video {
  position: absolute;
  top: 76.5%;
  left: 38.8%;
  z-index: 1;
  width: 26%;
  aspect-ratio: 135 / 76;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  transform: translateY(-50%);
  opacity: .84;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 70% 76% at 50% 55%, #000 0 43%, rgba(0, 0, 0, .92) 58%, rgba(0, 0, 0, .48) 76%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 76% at 50% 55%, #000 0 43%, rgba(0, 0, 0, .92) 58%, rgba(0, 0, 0, .48) 76%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.login-scene-video video {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: brightness(.6) contrast(1.6) saturate(.45) sepia(.72) hue-rotate(146deg) saturate(2.1);
}

@media (max-width: 680px) {
  .login-scene-video {
    display: none;
  }
}

.login-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  height: auto;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(39, 196, 255, .08), transparent 18%, transparent 82%, rgba(0, 11, 24, .74)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(84, 218, 255, .025) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(84, 218, 255, .02) 80px);
  pointer-events: none;
}

.login-stage::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  height: 2px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, #38cfff 24%, #79f2ff 50%, #38cfff 76%, transparent);
  box-shadow: 0 0 18px rgba(56, 207, 255, .75);
  opacity: .75;
}

.login-stage .brand-panel {
  min-height: 470px;
  padding: 0;
  visibility: hidden;
}

.login-illustration,
.login-stage .brand-copy {
  display: none;
}

.login-stage .login-card {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: end;
  width: 350px;
  margin: 0;
  padding: 0 24px 32px;
  border: 1px solid rgba(78, 211, 255, .38);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(7, 25, 43, .94), rgba(2, 11, 22, .88));
  box-shadow: 0 26px 70px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 34px rgba(21, 157, 220, .12);
  backdrop-filter: blur(18px);
}

.login-stage .login-card h2 {
  min-height: 82px;
  margin: 0 -24px 26px;
  border-bottom: 1px solid rgba(108, 218, 255, .22);
  color: #f4fbff;
  font-size: 25px;
  letter-spacing: .16em;
  text-shadow: 0 0 16px rgba(80, 213, 255, .35);
}

.login-stage .login-card label {
  gap: 9px;
  margin-bottom: 18px;
  color: #c9e7f4;
  font-weight: 600 !important;
  letter-spacing: .04em;
}

.login-stage .login-card input,
.login-stage .login-card select {
  min-height: 42px;
  border: 1px solid rgba(101, 201, 238, .38);
  border-radius: 6px;
  background: rgba(3, 14, 27, .78);
  color: #fff;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, .42);
  outline: none;
}

.login-stage .login-card input:focus,
.login-stage .login-card select:focus {
  border-color: #55d9ff;
  box-shadow: 0 0 0 3px rgba(70, 208, 255, .14), 0 0 18px rgba(58, 201, 255, .12);
}

.login-links {
  margin: 12px 2px 22px;
}

.login-links a,
.login-footer a {
  color: #55d9ff;
}

.login-stage .login-card button[type="submit"] {
  min-height: 44px;
  border: 1px solid rgba(124, 232, 255, .45);
  border-radius: 6px;
  background: linear-gradient(90deg, #087cab, #12a8d5 55%, #087cab);
  box-shadow: 0 10px 24px rgba(0, 128, 178, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
  font-size: 15px;
  letter-spacing: .12em;
}

.login-footer {
  min-height: 48px;
  align-items: center;
  padding: 0 28px;
  border-top: 1px solid rgba(79, 215, 255, .16);
  background: #030b16;
  color: #7f9bad;
  font-family: "Microsoft JhengHei", "Segoe UI", sans-serif;
}

@media (max-width: 1180px) {
  .login-stage {
    grid-template-columns: 1fr 330px;
    padding: 42px 30px;
    background-position: 36% center;
  }

  .login-stage .login-card {
    width: 330px;
  }
}

@media (max-width: 680px) {
  .login-view {
    grid-template-rows: 56px minmax(650px, 1fr) auto;
  }

  .login-topbar {
    height: 56px;
    padding: 0 16px;
  }

  .login-topbar-title {
    font-size: 18px;
  }

  .login-stage {
    grid-template-columns: 1fr;
    align-items: end;
    padding: 210px 16px 38px;
    background-image:
      linear-gradient(180deg, rgba(2, 9, 18, .02), rgba(2, 9, 18, .18) 34%, rgba(2, 9, 18, .92) 67%, #020914),
      url("assets/login/sci-fi-security-hero.png");
    background-position: 27% center;
  }

  .login-stage .brand-panel {
    display: none;
  }

  .login-stage .login-card {
    justify-self: center;
    width: min(350px, calc(100vw - 32px));
    margin-top: 0;
  }

  .login-footer {
    min-height: 52px;
    padding: 12px 16px;
  }
}
/* Final override: keep the planner rule row compact and vertically aligned. */
body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar {
  align-items: center !important;
  min-height: 23px !important;
  height: 23px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
}

.cashroom-process-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #d8e0e8);
  background: #f7f9fc;
}

.cashroom-process-strip span {
  padding: 9px 8px;
  border-radius: 8px;
  background: #e9eef5;
  color: #536274;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.cashroom-process-strip span.active {
  background: #173f67;
  color: #fff;
  font-weight: 700;
}

.cashroom-form-hint {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #d69a22;
  background: #fff8e7;
  color: #6a5426;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .cashroom-process-strip { grid-template-columns: repeat(3, 1fr); }
}

body:not(.guard-mobile-mode) .cashroom-prep-table { min-width: 760px !important; }
body:not(.guard-mobile-mode) .cashroom-receive-table { min-width: 1120px !important; }
body:not(.guard-mobile-mode) .cashroom-report-table { min-width: 1650px !important; }

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 20px !important;
  min-height: 20px !important;
  line-height: 20px !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-title {
  position: relative !important;
  top: -2px !important;
  transform: none !important;
  padding: 0 !important;
}

body:not(.guard-mobile-mode) .planner-grid-toolbar .planner-rule-bar input {
  height: 18px !important;
  min-height: 18px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 18px !important;
}

/* Final final override: planner rule row must match the toolbar row above. */
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar {
  flex: 0 0 calc(100% + 16px) !important;
  width: calc(100% + 16px) !important;
  min-height: 31px !important;
  height: 31px !important;
  margin: -4px -8px 0 !important;
  padding: 4px 8px !important;
  display: flex !important;
  align-items: center !important;
  align-content: center !important;
  gap: 8px !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #ffffff, #eef2f5) !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-title,
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar label {
  display: inline-flex !important;
  align-items: center !important;
  height: 23px !important;
  min-height: 23px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #33475a !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 23px !important;
  white-space: nowrap !important;
  position: static !important;
  top: auto !important;
  transform: none !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar input {
  height: 23px !important;
  min-height: 23px !important;
  padding: 2px 6px !important;
  line-height: normal !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}

/* Final planner top alignment: title, scope, rule and toolbar rows share the same left edge. */
body:not(.guard-mobile-mode) .content-grid:has(.planner-grid-header) .planner-grid-header,
body:not(.guard-mobile-mode) .content-grid:has(.planner-grid-header) .site-grid-toolbar.planner-grid-toolbar {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body:not(.guard-mobile-mode) .content-grid:has(.planner-grid-header) .planner-grid-header > *,
body:not(.guard-mobile-mode) .content-grid:has(.planner-grid-header) .site-grid-toolbar.planner-grid-toolbar > * {
  margin-left: 0 !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar {
  flex-basis: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Final planner top alignment spacing: keep one character gap from the left border. */
body:not(.guard-mobile-mode) .content-grid:has(.planner-grid-header) .planner-grid-header,
body:not(.guard-mobile-mode) .content-grid:has(.planner-grid-header) .site-grid-toolbar.planner-grid-toolbar {
  padding-left: 1em !important;
  padding-right: 1em !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar {
  flex-basis: calc(100% + 2em) !important;
  width: calc(100% + 2em) !important;
  margin-left: -1em !important;
  margin-right: -1em !important;
  padding-left: 1em !important;
  padding-right: 1em !important;
}

/* Final planner rule row indentation fix: avoid double left padding on the rule row. */
body:not(.guard-mobile-mode) .site-grid-toolbar.planner-grid-toolbar .planner-rule-bar {
  flex-basis: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Report management: parking fee monthly report table keeps Excel-like columns readable. */
body:not(.guard-mobile-mode) .parking-fee-report-table {
  min-width: 1900px !important;
}

body:not(.guard-mobile-mode) .parking-fee-report-table th,
body:not(.guard-mobile-mode) .parking-fee-report-table td {
  white-space: nowrap !important;
}

body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(4) {
  min-width: 190px !important;
  text-align: left !important;
}

body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(7),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(8),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(16),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(17),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(18),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(19),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(20),
body:not(.guard-mobile-mode) .parking-fee-report-table :is(th, td):nth-child(22) {
  text-align: right !important;
}

/* Project-wide desktop layout standard:
   management/report pages use zero outer gap; a single panel must fill the work area. */
body:not(.guard-mobile-mode) .content-grid {
  gap: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

body:not(.guard-mobile-mode) .content-grid:has(> .panel:only-child) {
  grid-template-columns: minmax(0, 1fr) !important;
}

body:not(.guard-mobile-mode) .content-grid:has(.parking-fee-report-table) {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  margin: 0 !important;
}

body:not(.guard-mobile-mode) .content-grid:has(.parking-fee-report-table) > .panel {
  width: 100% !important;
  max-width: none !important;
}

/* Parking fee report follows the customer's Excel workbook structure. */
body:not(.guard-mobile-mode) .parking-fee-excel-table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table th,
body:not(.guard-mobile-mode) .parking-fee-excel-table td {
  border: 1px solid #9fb4c8 !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 3px 6px !important;
  vertical-align: middle !important;
  text-align: center !important;
  white-space: nowrap !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table thead th {
  background: #eaf2f8 !important;
  font-weight: 400 !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table .parking-fee-title-row th {
  background: #fff !important;
  color: #002b55 !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  text-align: left !important;
  height: 32px !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table td.text-left {
  text-align: left !important;
}

body:not(.guard-mobile-mode) .report-empty-note {
  margin: 8px 0 0 !important;
}

body:not(.guard-mobile-mode) .report-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin: 0 !important;
}

body:not(.guard-mobile-mode) .report-summary div {
  border-radius: 0 !important;
}

body:not(.guard-mobile-mode) .report-summary strong {
  font-weight: 400 !important;
}

body:not(.guard-mobile-mode) .parking-fee-report-scroll {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

body:not(.guard-mobile-mode) .parking-fee-report-scroll .parking-fee-report-table {
  margin: 0 !important;
}

/* Parking fee report compact screen layout: numeric columns are short, avoid bottom scrollbar when possible. */
body:not(.guard-mobile-mode) .parking-fee-report-scroll {
  overflow-x: hidden !important;
}

body:not(.guard-mobile-mode) .parking-fee-report-table {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table th,
body:not(.guard-mobile-mode) .parking-fee-excel-table td {
  white-space: normal !important;
  word-break: keep-all !important;
  line-height: 1.15 !important;
  font-weight: 400 !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table thead tr:nth-child(2) th,
body:not(.guard-mobile-mode) .parking-fee-excel-table thead tr:nth-child(3) th {
  height: 42px !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table tbody td {
  height: 28px !important;
}

body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(1) { width: 42px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(2) { width: 84px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(3) { width: 84px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(4) { width: 150px !important; min-width: 0 !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(5),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(6) { width: 82px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(7),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(8) { width: 86px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(9),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(10),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(11),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(12),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(13),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(14),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(15) { width: 58px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(16) { width: 82px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(17),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(18),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(19),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(20),
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(22) { width: 76px !important; }
body:not(.guard-mobile-mode) .parking-fee-excel-table :is(th, td):nth-child(21) { width: 88px !important; }

/* Planner route controls: keep vehicle select and delete button same height and vertically centered. */
body:not(.guard-mobile-mode) .planner-table .planner-route-marker-row > td {
  height: 28px !important;
  min-height: 28px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: normal !important;
  vertical-align: middle !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-route-marker-cell {
  vertical-align: middle !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-route-marker-content {
  height: 28px !important;
  min-height: 28px !important;
  align-items: center !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-route-controls {
  height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  line-height: normal !important;
  vertical-align: middle !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-route-controls label {
  display: inline-grid !important;
  grid-template-columns: max-content minmax(0, 270px) !important;
  align-items: center !important;
  column-gap: 5px !important;
  height: 26px !important;
  line-height: 1 !important;
  margin: 0 !important;
  vertical-align: middle !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-route-controls select,
body:not(.guard-mobile-mode) .planner-table .planner-route-delete {
  box-sizing: border-box !important;
  height: 26px !important;
  min-height: 26px !important;
  line-height: 24px !important;
  margin: 0 !important;
  vertical-align: middle !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-route-delete {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body:not(.guard-mobile-mode) .site-grid-toolbar .planner-bulk-vehicle-field select {
  width: 260px !important;
  max-width: 28vw !important;
  position: relative !important;
  z-index: 12 !important;
  pointer-events: auto !important;
}

/* Planner table follows the no-gap admin layout: fill the viewport and keep numeric columns compact. */
body:not(.guard-mobile-mode) .planner-table-wrap {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body:not(.guard-mobile-mode) .planner-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

body:not(.guard-mobile-mode) .planner-table .planner-col-date { width: 90px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-vehicle { width: 62px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-order { width: 42px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-district { width: 70px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-code { width: 76px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-site { width: 23% !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-address { width: 31% !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-aps { width: 46px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-cycle { width: 78px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-service { width: 56px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-distance { width: 62px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-travel { width: 52px !important; }
body:not(.guard-mobile-mode) .planner-table .planner-col-total { width: 68px !important; }

body:not(.guard-mobile-mode) .planner-minute-input {
  display: inline-block !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  border: 0 !important;
  background: transparent !important;
  text-align: center !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
}

body:not(.guard-mobile-mode) .content-grid .planner-table .planner-site-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-address-cell {
  text-align: left !important;
}

body:not(.guard-mobile-mode) .content-grid .planner-table .planner-vehicle-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-order-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-district-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-code-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-aps-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-cycle-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-service-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-distance-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-travel-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-total-cell {
  text-align: center !important;
}

body:not(.guard-mobile-mode) .content-grid .planner-table .planner-distance-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-travel-cell,
body:not(.guard-mobile-mode) .content-grid .planner-table .planner-total-cell {
  padding-left: 2px !important;
  padding-right: 2px !important;
  white-space: nowrap !important;
}

body:not(.guard-mobile-mode) .planner-table th.planner-total-cell,
body:not(.guard-mobile-mode) .planner-table .planner-total-cell {
  position: sticky !important;
  right: 0 !important;
  z-index: 3 !important;
  min-width: 68px !important;
  width: 68px !important;
  background: #f8fbff !important;
  box-shadow: -1px 0 0 #c4d2e1;
}

.planner-temp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.planner-temp-modal {
  width: min(1080px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #fff;
  border: 1px solid #b9cce0;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.planner-temp-modal-header,
.planner-temp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d6e1ec;
  background: #f6fbff;
}

.planner-temp-modal-footer {
  border-top: 1px solid #d6e1ec;
  border-bottom: 0;
}

.planner-temp-modal-header strong {
  display: block;
  font-weight: 600;
  color: #0b3f70;
}

.planner-temp-modal-header span,
.planner-temp-modal-footer span {
  color: #52677a;
  font-size: 13px;
}

.planner-temp-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #d6e1ec;
}

.planner-temp-controls label {
  display: grid;
  gap: 3px;
  color: #23415f;
  font-size: 13px;
}

.planner-temp-controls select,
.planner-temp-controls input {
  height: 28px;
  padding: 2px 8px;
  border: 1px solid #b9cce0;
  border-radius: 3px;
  background: #fff;
  color: #0b2f55;
  font: inherit;
}

.planner-temp-search-field {
  grid-column: span 2;
}

.planner-temp-site-list {
  min-height: 260px;
  overflow: auto;
}

.planner-temp-table {
  width: 100%;
  table-layout: fixed;
}

.planner-temp-table th,
.planner-temp-table td {
  height: 26px;
  padding: 1px 6px;
  vertical-align: middle;
  border-color: #d6e1ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planner-temp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef6fc;
  box-shadow: 0 1px 0 #b9cce0;
}

.planner-temp-table .planner-temp-check-cell {
  width: 34px;
  text-align: center;
}

.planner-temp-table .planner-temp-check-cell input[type="checkbox"] {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  min-height: 13px !important;
  max-width: 13px !important;
  max-height: 13px !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
  transform: none !important;
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
}

.planner-temp-table .planner-code-cell {
  width: 86px;
}

.planner-temp-table .planner-company-cell,
.planner-temp-table .planner-district-cell,
.planner-temp-table .planner-aps-cell {
  text-align: center;
}

.planner-temp-table .planner-site-cell,
.planner-temp-table .planner-address-cell {
  text-align: left;
}

.planner-temp-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: #ffefb8;
  color: #8a5a00;
  font-size: 11px;
  line-height: 16px;
  vertical-align: middle;
}

.planner-temp-site-row > td {
  background: #fffaf0 !important;
}

.planner-calendar-report-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 14px;
}

.planner-calendar-report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 32, 40, .45);
}

.planner-calendar-report-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1220px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: hidden;
  border: 1px solid #b9cbd9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 40, 55, .28);
}

.planner-calendar-report-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 6px 12px;
  border-bottom: 1px solid #d6e1ec;
  background: #f6fafc;
}

.planner-calendar-report-dialog > header div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.planner-calendar-report-dialog > header strong {
  color: #17324d;
  font-size: 16px;
  font-weight: 600;
}

.planner-calendar-report-dialog > header span {
  overflow: hidden;
  color: #52677a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-calendar-report-dialog > header button {
  height: 28px;
  padding: 3px 12px;
  border: 1px solid #9fc4df;
  border-radius: 4px;
  background: #fff;
  color: #0d6094;
  cursor: pointer;
}

.planner-calendar-report-dialog > header .planner-calendar-report-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.planner-calendar-report-body {
  min-height: 0;
  overflow: auto;
  padding: 0 10px 10px;
}

.planner-calendar-sticky-head {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 0 -10px;
  padding: 8px 10px 0;
  border-bottom: 1px solid #cbd8e2;
  background: #fff;
}

.planner-calendar-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 8px;
}

.planner-calendar-report-head > div:first-child {
  display: grid;
  gap: 2px;
}

.planner-calendar-report-head strong {
  color: #17324d;
  font-size: 18px;
  font-weight: 600;
}

.planner-calendar-report-head span {
  color: #52677a;
}

.planner-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
  font-size: 12px;
}

.planner-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.planner-calendar-legend i {
  display: inline-block;
  width: 18px;
  height: 10px;
  border: 1px solid rgba(15, 47, 74, .14);
  border-radius: 2px;
}

.planner-calendar-weekdays,
.planner-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.planner-calendar-weekdays > div {
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd8e2;
  border-right: 0;
  background: #eaf2f8;
  color: #17324d;
  font-weight: 400;
}

.planner-calendar-weekdays > div:last-child {
  border-right: 1px solid #cbd8e2;
}

.planner-calendar-day {
  min-height: 116px;
  padding: 4px;
  border-left: 1px solid #d6e1ec;
  border-bottom: 1px solid #d6e1ec;
  background: #fff;
}

.planner-calendar-day:nth-child(7n) {
  border-right: 1px solid #d6e1ec;
}

.planner-calendar-day.is-empty,
.planner-calendar-day.is-no-task {
  background: #fafcfe;
}

.planner-calendar-date {
  margin-bottom: 3px;
  color: #52677a;
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
}

.planner-calendar-sites {
  display: grid;
  gap: 2px;
}

.planner-calendar-site {
  display: block;
  overflow: hidden;
  padding: 2px 4px;
  border: 1px solid rgba(15, 47, 74, .10);
  border-radius: 4px;
  color: #17324d;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-calendar-site.freq-daily,
.planner-calendar-legend i.freq-daily {
  background: #ffe9e9;
}

.planner-calendar-site.freq-weekly,
.planner-calendar-legend i.freq-weekly {
  border-color: #86bff0;
  background: #d7ecff;
}

.planner-calendar-site.freq-biweekly,
.planner-calendar-legend i.freq-biweekly {
  background: #fff3d8;
}

.planner-calendar-site.freq-weekday,
.planner-calendar-legend i.freq-weekday {
  background: #e9f8ed;
}

.planner-calendar-site.freq-monthly,
.planner-calendar-legend i.freq-monthly {
  background: #f2eafa;
}

.planner-calendar-site.freq-temp,
.planner-calendar-legend i.freq-temp {
  background: #f1f5f9;
}

.planner-calendar-site.freq-other,
.planner-calendar-legend i.freq-other {
  background: #eef2f7;
}

@media (max-width: 900px) {
  .planner-temp-controls {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .planner-temp-search-field {
    grid-column: span 2;
  }
}

body:not(.guard-mobile-mode) .planner-table th.planner-total-cell {
  z-index: 5 !important;
  background: linear-gradient(180deg, #ffffff, #f1f4f6) !important;
}

/* Final override: task tracking must wrap station cards into upper/lower rows instead of one long horizontal line. */
body:not(.guard-mobile-mode) .tracking-route-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body:not(.guard-mobile-mode) .tracking-route-card {
  min-width: 0 !important;
  overflow: visible !important;
}

body:not(.guard-mobile-mode) .tracking-flow {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 144px) !important;
  justify-content: start !important;
  align-items: center !important;
  align-content: flex-start !important;
  gap: 8px 0 !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body:not(.guard-mobile-mode) .tracking-flow-segment {
  width: 144px !important;
  min-width: 144px !important;
  max-width: 144px !important;
  display: grid !important;
  grid-template-columns: 26px 118px !important;
  align-items: center !important;
  margin: 0 !important;
}

body:not(.guard-mobile-mode) .tracking-flow > .tracking-stop-card.origin,
body:not(.guard-mobile-mode) .tracking-stop-card {
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
}

/* Site information: follow site management style, with compact rows and photo thumbnails. */
body:not(.guard-mobile-mode) .site-info-page {
  gap: 0 !important;
}

body:not(.guard-mobile-mode) .content-grid:has(.site-info-page) {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  height: calc(100vh - 66px) !important;
  margin: 0 !important;
  gap: 0 !important;
}

body:not(.guard-mobile-mode) .site-info-page .site-tree-toolbar {
  display: none !important;
}

body:not(.guard-mobile-mode) .site-info-page .site-tree-panel {
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

body:not(.guard-mobile-mode) .site-info-page .site-name-panel {
  min-width: 0 !important;
}

body:not(.guard-mobile-mode) .site-info-page .site-grid-title {
  min-height: 34px !important;
  padding: 6px 8px !important;
}

body:not(.guard-mobile-mode) .site-info-page .site-grid-toolbar {
  min-height: 32px !important;
  padding: 4px 8px !important;
}

body:not(.guard-mobile-mode) .site-info-table {
  min-width: 1120px !important;
}

body:not(.guard-mobile-mode) .site-info-table th,
body:not(.guard-mobile-mode) .site-info-table td {
  height: 32px !important;
  min-height: 32px !important;
  padding: 4px 6px !important;
  vertical-align: middle !important;
  line-height: 1.35 !important;
}

body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(1) { width: 46px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(2) { width: 82px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(3) { width: 70px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(4) { width: 180px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(5) { width: 74px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(6) { width: 84px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(7) { width: 260px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(8) { width: auto !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(9) { width: 58px !important; }
body:not(.guard-mobile-mode) .site-info-table :is(th, td):nth-child(10) { width: 120px !important; }

body:not(.guard-mobile-mode) .site-info-table td:nth-child(3),
body:not(.guard-mobile-mode) .site-info-table td:nth-child(5),
body:not(.guard-mobile-mode) .site-info-table td:nth-child(6),
body:not(.guard-mobile-mode) .site-info-table td:nth-child(9),
body:not(.guard-mobile-mode) .site-info-table td:nth-child(10) {
  text-align: center !important;
}

body:not(.guard-mobile-mode) .site-info-table td:nth-child(4),
body:not(.guard-mobile-mode) .site-info-table td:nth-child(7),
body:not(.guard-mobile-mode) .site-info-table td:nth-child(8) {
  text-align: left !important;
}

.site-info-table tr[data-open-site-info] {
  cursor: pointer;
}

.site-info-note-cell {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-info-dialog textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.site-info-photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.site-info-photo-card {
  display: grid;
  gap: 5px;
  align-content: start;
  border: 1px solid var(--line);
  background: #f8fbff;
  padding: 6px;
}

.site-info-photo-card.is-pending {
  background: #fff9e8;
  border-color: #e6c46a;
}

.site-info-photo-thumb {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.site-info-photo-thumb img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.site-info-photo-caption-text,
.site-info-photo-meta,
.site-info-photo-status {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.site-info-photo-meta,
.site-info-photo-status {
  color: var(--muted);
}

.site-info-photo-caption-input {
  height: 26px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 6px;
  font: inherit;
}

.site-info-photo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.site-info-photo-actions button {
  min-height: 24px;
  padding: 2px 8px;
}
