/* 後台（店長 / HQ）— 明亮工業實用轉譯：資料是主角、hairline 分隔、單一紅強調 */
[hidden] { display: none !important; }
.err { color: var(--red); min-height: 1.4em; font-size: 14px; margin-top: var(--s2); }
.small { font-size: 13px; }
.r { text-align: right; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); border: 1px solid var(--hair); border-radius: var(--r); min-height: 40px; padding: 0 var(--s3); font-size: 14px; }
.btn.ghost { border-color: transparent; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: min(400px, 92vw); background: var(--white); border: 1px solid var(--hair); border-radius: var(--r); padding: var(--s6); }
.brand-mark { font-family: var(--serif); font-weight: 900; font-size: 36px; line-height: 1; text-align: center; }
.brand-mark.sm { font-size: 20px; text-align: left; }
.brand-sub { text-align: center; color: var(--ink-3); font-size: 12px; letter-spacing: .18em; margin: var(--s3) 0 var(--s5); }
.login-card label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: var(--s3); }
.login-card label.inline-check { display: flex; align-items: center; gap: var(--s2); min-height: 32px; }
.login-card label.inline-check input { display: inline-block; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--red); }
.login-card input { display: block; width: 100%; margin-top: 4px; height: 48px; padding: 0 var(--s3); border: 1px solid var(--hair); border-radius: var(--r); background: var(--paper); font-size: 17px; }
.login-card button { width: 100%; margin-top: var(--s2); }

.entry-page { min-height: 100vh; background: var(--paper); }
.entry-wrap { width: min(520px, calc(100% - var(--s6))); min-height: 100vh; margin: 0 auto; padding: var(--s7) 0 var(--s5); display: flex; flex-direction: column; align-items: center; text-align: center; }
.entry-logo { width: min(220px, 64vw); max-height: 64px; object-fit: contain; }
.entry-kicker { margin: var(--s2) 0 var(--s5); color: var(--red); font-size: 12px; letter-spacing: .2em; }
.entry-wrap h1 { margin: 0; font-family: var(--serif); font-size: clamp(28px, 7vw, 38px); font-weight: 600; }
.entry-lead { margin: var(--s3) 0 var(--s5); color: var(--ink-2); }
.entry-links { width: 100%; display: grid; gap: var(--s3); }
.entry-links a { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); color: var(--ink); text-decoration: none; text-align: left; background: var(--white); border: 1px solid var(--hair); border-radius: var(--r); }
.entry-links a:hover, .entry-links a:focus-visible { border-color: var(--red); }
.entry-links span { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.entry-links small { color: var(--ink-2); font-size: 13px; }
.entry-sig { margin-top: auto; padding-top: var(--s6); }

.bo-top { height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--s5); border-bottom: 1px solid var(--hair); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.update-bar {
  position: sticky;
  top: 56px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 40px;
  padding: 0 var(--s5);
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
}

.update-bar span { flex: 1; }
.update-bar button {
  min-height: 32px;
  border-color: var(--paper);
  background: transparent;
  color: var(--paper);
  white-space: nowrap;
}
.update-bar #updateNow {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--red);
}
.bo-brand { display: flex; align-items: center; gap: var(--s3); font-size: 14px; }
.bo-brand .logo { height: 34px; }
.tb-rule { width: 2px; height: 22px; background: var(--red); border-radius: 1px; }
.bo-foot { max-width: 1280px; margin: 0 auto; padding: var(--s4) var(--s5) var(--s6); display: flex; justify-content: flex-end; border-top: 1px solid var(--hair); }
.login-foot { text-align: center; margin-top: var(--s5); }
.bo-nav { display: flex; gap: 2px; background: var(--paper-2); padding: 3px; border-radius: var(--r); }
.bo-nav .tab { min-height: 38px; border: none; background: transparent; padding: 0 var(--s4); font-size: 14px; color: var(--ink-2); }
.bo-nav .tab.active { background: var(--ink); color: var(--paper); font-weight: 700; }
.bo-right { display: flex; justify-content: flex-end; gap: var(--s2); }
.bo-main { max-width: 1280px; margin: 0 auto; padding: var(--s5); }
.bo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s4); flex-wrap: wrap; gap: var(--s3); }
.bo-head h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 24px; }
.bo-tools { display: flex; gap: var(--s2); align-items: center; }
.bo-tools input, .field input, .field select, .field textarea { height: 40px; padding: 0 var(--s3); border: 1px solid var(--hair); border-radius: var(--r); background: var(--white); font-size: 15px; }
.field { display: block; margin: var(--s3) 0; font-size: 13px; color: var(--ink-2); }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 4px; height: 44px; font-size: 16px; }
.field textarea { height: auto; min-height: 90px; padding: var(--s2) var(--s3); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
button.sm { min-height: 40px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
/* v0.4.9 金額太長會超出卡片（Hank 10-18：NT$309,580）→ 字級跟著卡片寬度縮放（cqi），不支援的舊瀏覽器退回 22px */
.kpi { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r); padding: var(--s3) var(--s4); container-type: inline-size; min-width: 0; }
.kpi .k { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; }
.kpi .v { font-family: var(--serif); font-weight: 600; font-size: 22px; font-size: clamp(12px, 13cqi, 26px); line-height: 1.2; margin-top: 2px; }
.kpi.accent { border-left: 4px solid var(--red); }
.kpi.good .v { color: var(--green); } .kpi.bad .v { color: var(--red); }
.light { display: inline-block; width: 10px; height: 10px; margin-right: var(--s1); border-radius: 50%; background: var(--ink-3); vertical-align: middle; }
.light.light-ok { background: var(--green); } .light.light-warn { background: color-mix(in srgb, var(--ink) 60%, transparent); } .light.light-bad { background: var(--red); } .light.light-off { background: var(--ink-3); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-bottom: var(--s4); }
.panel { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r); padding: var(--s4); margin-bottom: var(--s4); }
.panel h2 { margin: 0 0 var(--s3); font-size: 15px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--hair); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: var(--paper); }
.tbl .r { text-align: right; }
.tbl td.neg { color: var(--red); font-weight: 700; } .tbl td.pos { color: var(--green); }
.tbl input { height: 34px; padding: 0 6px; border: 1px solid var(--hair); border-radius: 4px; width: 100%; background: var(--paper); font-size: 14px; }
.tbl input.num { text-align: right; width: 80px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--hair); color: var(--ink-2); }
.tag.ok { border-color: var(--green); color: var(--green); } .tag.bad { border-color: var(--red); color: var(--red); background: var(--red-wash); } .tag.warn { border-color: var(--warn); color: var(--warn); }

.bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 160px; padding-top: var(--s3); }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--ink-3); }
.bar i { display: block; width: 100%; background: var(--ink); border-radius: 2px 2px 0 0; min-height: 2px; }
.bar b { font-weight: 500; color: var(--ink); font-size: 12px; margin-bottom: 2px; }
.dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 var(--s3); font-size: 15px; }
.dl dt { color: var(--ink-2); } .dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.dl dd.big { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.diff { font-size: 20px; font-weight: 700; margin: var(--s2) 0 var(--s3); min-height: 1.4em; }
.diff.neg { color: var(--red); } .diff.pos { color: var(--green); }

.stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.store-card { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r); padding: var(--s4); display: grid; gap: var(--s2); }
.store-card .sc-h { display: flex; justify-content: space-between; align-items: baseline; }
.store-card .sc-h b { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.store-card .sc-rev { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.1; }
.store-card .sc-meta { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.store-card .sc-actions { display: flex; gap: var(--s2); margin-top: var(--s1); }
.store-card.suspended { opacity: .6; }

.json-hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } .bo-top { grid-template-columns: 1fr; height: auto; padding: var(--s2) var(--s3); gap: var(--s2); } .bo-right { justify-content: flex-start; } }

/* v0.2 店長後台與共用菜單編輯器（只新增，不影響既有頁面） */
.who { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--hair); border-radius: var(--r); padding: 5px var(--s2); font-size: 13px; cursor: pointer; background: var(--white); }
.bo-foot { justify-content: space-between; gap: var(--s3); flex-wrap: wrap; } .bo-foot-links { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 13px; } .bo-foot a:not(.sig) { color: var(--ink-2); }
.scroll-x { overflow-x: auto; } .nav-scroll { overflow-x: auto; } .nav-scroll .bo-nav { width: max-content; }
.panel.danger { border-color: var(--red); background: var(--red-wash); } .panel.danger h2 { color: var(--red); }
.row-actions { display: flex; gap: var(--s2); flex-wrap: wrap; } .row-actions button, .row-actions .btn { min-height: 40px; }
.inline-check { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; font-size: 13px; color: var(--ink-2); }
.analysis-bars { grid-template-columns: repeat(7, 1fr); } .analysis-bars .bar i { background: var(--red); }
.schedule-wrap { overflow-x: auto; } .schedule { min-width: 900px; } .schedule th:first-child, .schedule td:first-child { position: sticky; left: 0; z-index: 1; background: var(--white); } .schedule th:first-child { z-index: 2; background: var(--paper); } .schedule .today { box-shadow: inset 2px 0 var(--red); } .schedule-cell { min-width: 118px; text-align: left; padding: 5px; } .shift-pill { border-left: 3px solid var(--ink); padding-left: 5px; display: block; font-size: 12px; margin: 2px 0; } .shift-rest { color: var(--ink-3); } .schedule-total { font-weight: 700; }
.attendance-detail td { background: var(--paper); } .attendance-detail table { width: 100%; font-size: 13px; } .attendance-detail th, .attendance-detail td { padding: 6px; border-bottom: 1px solid var(--hair); }
.row-flash td { background: var(--red-wash) !important; }
.me-layout { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 2fr); gap: var(--s4); } .me-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); } .me-title h2, .me-title h4 { margin: 0; font-family: var(--serif); } .me-title p { margin: 2px 0 0; }
.me-cat { display: grid; grid-template-columns: 1fr auto; gap: var(--s1); border-bottom: 1px solid var(--hair); } .me-cat-name { min-height: 48px; text-align: left; border: 0; border-radius: 0; background: transparent; padding: 0 var(--s2); } .me-cat-name span { display: block; color: var(--ink-3); font-size: 12px; } .me-cat.selected .me-cat-name { border-left: 3px solid var(--red); background: var(--paper-2); } .me-mini { display: flex; align-items: center; gap: 0; } .me-mini button { padding: 0 6px; }
.me-item-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s3); } .me-item { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; min-height: 190px; padding: var(--s3); border: 1px solid var(--hair); border-radius: var(--r); background: var(--white); } .me-item-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); } .me-item h3 { margin: 0; font-size: 17px; } .me-price { font-family: var(--serif); font-size: 25px; margin: 0; } .me-item p { margin: 0; font-size: 13px; color: var(--ink-2); } .me-item-note { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-height: 2.8em; } .me-item-actions { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--s1); margin-top: auto; } .me-item-actions button { min-height: 44px; min-width: 0; padding: 0 var(--s1); } .me-empty { padding: var(--s5) 0; }
.me-modal-bg { position: fixed; inset: 0; display: none; justify-content: center; align-items: center; padding: var(--s4); background: var(--scrim); z-index: 50; } .me-modal-bg.open { display: flex; } .me-modal { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r); width: min(760px,100%); max-height: 94vh; overflow: auto; box-shadow: var(--shadow-md); } .me-modal header, .me-modal footer { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--hair); } .me-modal footer { border-bottom: 0; border-top: 1px solid var(--hair); justify-content: flex-end; } .me-modal h3 { margin: 0; font-family: var(--serif); } .me-modal .body { padding: var(--s4) var(--s5); }
.me-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s3); } .me-check { display: flex; align-items: center; gap: var(--s2); } .me-check input { width: auto !important; height: auto !important; margin: 0 !important; } .me-options, .me-layout-opts { border-top: 1px solid var(--hair); margin-top: var(--s4); padding-top: var(--s4); } .me-layout-opts h4 { margin: 0 0 var(--s3); font-family: var(--serif); } .me-layout-opts .inline-check { margin-bottom: var(--s3); } .me-group { border: 1px solid var(--hair); padding: var(--s3); margin: var(--s3) 0; border-radius: var(--r); } .me-group-head { display: grid; grid-template-columns: minmax(0,1fr) auto 110px auto; gap: var(--s2); align-items: end; } .me-group label { font-size: 13px; color: var(--ink-2); } .me-group input { display: block; width: 100%; height: 38px; border: 1px solid var(--hair); border-radius: var(--r); background: var(--white); padding: 0 var(--s2); } .me-choices { margin: var(--s3) 0; } .me-choice { display: grid; grid-template-columns: minmax(0,1fr) 90px auto auto; gap: var(--s2); margin: var(--s2) 0; align-items: center; } .me-choice input { height: 38px; border: 1px solid var(--hair); border-radius: var(--r); background: var(--white); padding: 0 var(--s2); }
@media (max-width: 820px) { .bo-main { padding: var(--s3); } .me-layout { grid-template-columns: 1fr; } .me-form-grid { grid-template-columns: 1fr; } .me-group-head { grid-template-columns: 1fr 1fr; } .me-choice { grid-template-columns: minmax(0,1fr) 72px auto; } .me-choice button { grid-column: 1 / -1; } .who { max-width: 190px; } }

@media (max-width: 700px) {
  .bo-top {
    height: 48px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s2);
    padding: 0 var(--s3);
  }
  .update-bar { top: 48px; padding: 0 var(--s3); }
  .bo-top > .bo-nav,
  .bo-top > .nav-scroll { display: none; }
  .bo-brand { min-width: 0; gap: var(--s2); }
  .bo-brand .logo { height: 28px; }
  .bo-brand > :last-child { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-rule { width: 2px; height: 18px; }
  .bo-right { min-width: 0; }
  .bo-right > :not(.who) { display: none; }
  .bo-right .who { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }

  .bo-main { padding: var(--s3) var(--s3) 80px; }
  .bo-head { align-items: stretch; flex-direction: column; }
  .bo-head h1 { font-size: 20px; }
  .bo-tools { flex-wrap: wrap; }
  .bo-tools > button,
  .bo-tools > .btn { min-height: 44px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi:first-child { grid-column: 1 / -1; }
  .kpis .kpi:first-child .v { font-size: 28px; font-size: clamp(16px, 13cqi, 32px); }

  .stores { grid-template-columns: minmax(0, 1fr); }
  .store-card .sc-rev { font-size: 30px; }
  .store-card .sc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-card .sc-actions > * { min-height: 44px; }

  .scroll-x { overflow-x: auto; }
  .tbl th,
  .tbl td { padding: 8px; font-size: 13px; white-space: nowrap; }

  .modal-bg { align-items: flex-end; padding: 0; }
  .modal {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    overflow: auto;
  }
  .two { grid-template-columns: 1fr; }
  button.sm { min-height: 40px; padding: 0 12px; }

  .bo-foot { display: none; }

  .bo-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--hair);
    background: var(--paper);
  }
  .bo-tabbar .tab {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 56px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
  }
  .bo-tabbar .tab.active { background: transparent; color: var(--ink); font-weight: 700; }
  .bo-tabbar .tab.active::before { position: absolute; top: 0; right: var(--s2); left: var(--s2); height: 2px; background: var(--red); content: ''; }
  .bo-tabbar-symbol { display: block; height: 15px; font-size: 16px; line-height: 15px; }
  .bo-tabbar-label { overflow: hidden; max-width: 100%; text-overflow: ellipsis; }

  .bo-sheet-bg {
    position: fixed;
    inset: 0;
    z-index: 7;
    display: none;
    align-items: flex-end;
    background: var(--scrim);
  }
  .bo-sheet-bg.open { display: flex; }
  .bo-sheet {
    width: 100%;
    max-height: min(82vh, 640px);
    overflow: auto;
    border: 1px solid var(--hair);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--paper);
    animation: bo-sheet-up var(--normal) var(--ease) both;
  }
  .bo-sheet header,
  .bo-sheet footer { padding: var(--s3); }
  .bo-sheet header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hair); }
  .bo-sheet header h2 { margin: 0; font-family: var(--serif); font-size: 18px; }
  .bo-sheet-list { display: grid; padding: var(--s2) var(--s3); }
  .bo-sheet-link { min-height: 48px; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
  .bo-sheet-link:last-child { border-bottom: 0; }
  .bo-sheet-divider { height: 1px; margin: var(--s2) var(--s3); background: var(--hair); }
  .bo-sheet footer { border-top: 1px solid var(--hair); }
  .bo-sheet-help { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
  .bo-sheet-help a { color: var(--ink-2); font-size: 13px; }
  .bo-sheet .sig { color: var(--ink); }

  @keyframes bo-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
}

.expense-box { padding: var(--s3) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.expense-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.expense-head h3 { margin: 0; font-family: var(--serif); font-size: 15px; }
.expense-list { margin: var(--s2) 0; padding: 0; list-style: none; }
.expense-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--s2); min-height: 44px; border-bottom: 1px solid var(--hair); }
.expense-list li:first-child { border-top: 1px solid var(--hair); }
.expense-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.expense-chips button.ghost { border-color: var(--hair); background: var(--paper); }
.expense-add { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: var(--s2); }
.expense-add input { min-width: 0; min-height: 44px; font-size: 16px; }
.expense-chips .sm, .expense-list .sm, .expense-add .sm { min-height: 44px; }
@media (max-width: 700px) {
  .expense-add { grid-template-columns: minmax(0, 1fr) auto; }
  .expense-add input:first-child { grid-column: 1 / -1; }
}
/* 結班頁：「結班紀錄」欄位多。寬螢幕（≥1100px）左右兩欄、紀錄佔六成；較窄時上下排（結班在上、紀錄在下）。
   表頭、數字與按鈕不折行，放不下就在面板內橫向捲動；minmax(0, …) 防止表格把欄位撐開 */
.closing-cols { grid-template-columns: minmax(0, 1fr); }
.closing-cols > * { min-width: 0; }
@media (min-width: 1100px) { .closing-cols { grid-template-columns: minmax(0, 9fr) minmax(0, 16fr); } }
#closingsTbl .row-actions { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px; }
#closingsTbl th, #closingsTbl td { padding-left: 6px; padding-right: 6px; }
#closingsTbl th, #closingsTbl td.r, #closingsTbl td:first-child, #closingsTbl .row-actions button, #closingsTbl .row-actions .btn { white-space: nowrap; }
#closingsTbl td.small { min-width: 6em; }
/* 頂欄「前往 ▾」選單（總部）：跳到任一門市的櫃台／店長後台／排班 */
.go-nav { position: relative; display: inline-block; }
.go-menu { position: absolute; z-index: 30; top: calc(100% + var(--s1)); right: 0; min-width: 220px; max-height: 70vh; overflow-y: auto; padding: var(--s1); border: 1px solid var(--hair); border-radius: var(--r); background: var(--paper); text-align: left; }
.go-menu a { display: flex; min-height: 44px; align-items: center; padding: 0 var(--s3); color: var(--ink); font-size: 14px; text-decoration: none; }
.go-menu a:hover { background: var(--red-wash); }
.go-menu .go-title { padding: var(--s2) var(--s3) var(--s1); color: var(--ink-3); font-size: 12px; letter-spacing: .06em; }
.go-menu .go-sub { border-bottom: 1px solid var(--hair); }
.go-menu .go-sub:last-child { border-bottom: 0; }
.btn.red { background: var(--red); color: var(--on-red); border-color: var(--red); font-weight: 700; }
.btn.sm { min-height: 40px; padding: 0 var(--s3); font-size: 14px; }
/* 頂欄：兩側（品牌、右側按鈕）維持自己的寬度不折行，中間分頁列吃剩下的空間、放不下就橫向滑動（不顯示捲軸） */
@media (min-width: 821px) {
  .bo-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); }
  .bo-top > .nav-scroll, .bo-top > .bo-nav { justify-self: center; max-width: 100%; }
}
.bo-brand, .bo-right { white-space: nowrap; }
.bo-right { align-items: center; }
.bo-right > * { flex-shrink: 0; }
.bo-right .who { flex-shrink: 1; min-width: 0; }
.nav-scroll { scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 821px) { .bo-top > .bo-nav { overflow-x: auto; scrollbar-width: none; } .bo-top > .bo-nav::-webkit-scrollbar { display: none; } .bo-top > .bo-nav .tab { flex-shrink: 0; white-space: nowrap; } }
/* 登入框：大標題寫清楚這是哪個入口、要用哪種帳號；最上面一顆大的返回鍵（點錯入口可以回去重選） */
.login-title { margin: var(--s2) 0 var(--s1); text-align: center; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.2; }
.login-hint { margin: 0 0 var(--s4); text-align: center; color: var(--ink-2); font-size: 16px; }
.login-hint b { color: var(--red); }
.login-back { display: flex; align-items: center; justify-content: center; margin: 0 0 var(--s4); min-height: 56px; color: var(--ink); font-size: 17px; font-weight: 700; text-decoration: none; background: var(--paper-2); border: 1px solid var(--hair); border-radius: var(--r); }
.login-back:hover, .login-back:active { border-color: var(--red); }
.entry-links em { display: block; margin-top: 2px; font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 500; color: var(--green); }
.entry-links em.need { color: var(--ink-3); }
/* 入口頁：三顆大按鈕，一眼知道往哪裡 */
.entry-wrap { width: min(640px, calc(100% - var(--s6))); }
.entry-links { gap: var(--s4); }
.entry-links a { min-height: 104px; padding: var(--s4) var(--s5); border-width: 2px; }
.entry-links a:active { border-color: var(--red); background: var(--red-wash); }
.entry-links span { font-size: 30px; }
.entry-links em { margin-top: 4px; font-size: 14px; }
.entry-links small { font-size: 15px; text-align: right; }
.entry-lead { font-size: 18px; }
@media (max-width: 520px) { .entry-links a { flex-direction: column; align-items: flex-start; gap: var(--s1); } .entry-links small { text-align: left; } }
.login-back.attn { border-color: var(--red); color: var(--red); background: var(--red-wash); }
.login-card .err { margin-top: var(--s2); font-size: 15px; font-weight: 700; line-height: 1.5; }
/* 月報分析：報廢與現金支出改成表格並排（v0.4.5；原本一長串文字太亂） */
.analysis-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.analysis-bottom .panel { min-width: 0; margin-bottom: 0; }
.analysis-bottom .tbl-scroll { max-height: 360px; overflow: auto; }
.analysis-bottom .scroll-x + .tbl-scroll { margin-top: var(--s3); }
.analysis-bottom .tbl-scroll thead th { position: sticky; top: 0; background: var(--white); }
.analysis-bottom tfoot th { padding: 8px; border-top: 2px solid var(--hair); color: var(--ink); font-weight: 700; font-size: 14px; }
.analysis-bottom .panel-foot { margin-top: var(--s3); }
.analysis-bottom .tbl { table-layout: fixed; width: 100%; }
.analysis-bottom .tbl th:first-child { width: 52%; }
@media (max-width: 820px) { .analysis-bottom { grid-template-columns: minmax(0, 1fr); } }

/* 主題切換：手機沿用「更多」sheet。 */
.bo-right [data-theme-toggle] { min-height: 44px; }
@media (max-width: 700px) {
  .bo-right [data-theme-toggle] { display: none; }
}

.bo-foot { flex-wrap: wrap; gap: var(--s2); }
