/* AC+ Mac 工作介面。原生元件、系統字體與即時按壓回饋；共用 styles.css 不修改。 */
:root { --bg: #f5f5f7; --panel: #fff; --ink: #202124; --ink-soft: #35373a; --muted: #70757a; --line: #e5e5e8; --accent: #0071e3; --radius: .625rem; font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
body { font-family: inherit; font-size: .8125rem; color: var(--ink); font-optical-sizing: auto; }
button, input, select, textarea { font: inherit; }
button { transition: background-color 120ms ease, color 120ms ease; touch-action: manipulation; }
button:active:not(:disabled), summary:active { background-color: #dce9f8; }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .table-scroll:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; box-shadow: none; }
input, select, textarea { color: var(--ink); background: #fff; border: 1px solid #d5d5da; border-radius: .4375rem; padding: .4375rem .625rem; min-height: 2rem; }
select { appearance: auto; background-image: none; }
input[type="checkbox"] { width: .9375rem; height: .9375rem; min-height: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
.primary-btn, .ghost-btn { height: auto; min-height: 2rem; padding: .375rem .6875rem; border-radius: .4375rem; font-size: .75rem; font-weight: 550; white-space: nowrap; box-shadow: none; }
.primary-btn { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.primary-btn:hover:not(:disabled) { background: #0065cc; border-color: #0065cc; }
.primary-btn:active:not(:disabled) { background: #0055b3; transform: none; }
.ghost-btn { background: #fff; color: var(--ink-soft); border: 1px solid #dedee2; }
.ghost-btn:hover:not(:disabled) { background: #f0f1f4; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted-text { color: var(--muted); font-size: .75rem; line-height: 1.65; }
.error { color: #b42318; }
h1 { font-size: 1.625rem; line-height: 1.2; letter-spacing: -.025em; font-weight: 650; }
h2 { margin: 0; font-size: 1rem; line-height: 1.35; letter-spacing: -.015em; font-weight: 620; }
.login-view { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 25rem; padding: 2rem; display: grid; gap: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 12px 40px #18203808; }
.login-card p { margin: 0 0 .5rem; }
.app-shell { width: 100%; max-width: 1800px; padding: 0 1.75rem 1.5rem; }
.topbar { padding: .75rem 0; margin: 0; border: 0; }
.topbar::before { display: none; }
.topbar .brand { gap: .625rem; }
.brand-mark { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: .5625rem; color: white; background: #25272b; font-size: .75rem; font-weight: 800; letter-spacing: -.02em; }
.brand-plus { color: #2997ff; margin-left: .03em; }   /* 跟網站 icon 一致：AC 白字、+ 藍色 */
.brand .eyebrow { margin: 0; font-size: .5rem; letter-spacing: .1em; }
.brand strong { font-size: .8125rem; }
.account { margin-left: auto; font-size: .75rem; color: var(--muted); }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0 1.25rem; }
.workspace-heading p { margin: .375rem 0 0; }
.date-controls { display: flex; align-items: center; gap: .3125rem; padding: .25rem; background: #ffffffb8; backdrop-filter: blur(16px) saturate(140%); border: 1px solid #e8e8ec; border-radius: .75rem; }
.date-controls input { width: 9rem; border-color: transparent; background: transparent; }
.date-controls .ghost-btn { border: 0; background: transparent; }
.date-controls .date-arrow { width: 1.875rem; padding: .125rem; font-size: 1.5rem; line-height: 1; }
#date-range-label { white-space: nowrap; font-size: .75rem; font-variant-numeric: tabular-nums; padding: 0 .25rem; }
.work-content { min-width: 0; }
.manager-layout { display: grid; grid-template-columns: 11.75rem minmax(0, 1fr); gap: 1.375rem; align-items: start; }
.shop-sidebar { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; border: 0; background: #eaeaf080; border-radius: .75rem; padding: .5rem; }
.scope-button { width: 100%; min-height: 2.125rem; padding: .5rem .625rem; text-align: left; border-radius: .4375rem; border: 0; color: var(--ink); background: transparent; font-weight: 600; font-size: .75rem; }
.scope-button:hover { background: #dfdfe6; }
.scope-button.is-active { background: #dce8f6; color: #075daf; }
#shop-directory { overflow: auto; min-height: 8rem; scrollbar-width: thin; }
.directory-region { position: sticky; top: 0; margin: 0; padding: .875rem .625rem .375rem; background: #ededf2; color: #666a72; font-size: .625rem; font-weight: 650; letter-spacing: .025em; z-index: 1; }
.shop-option { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; min-height: 2.1875rem; padding: .4375rem .625rem; border: 0; border-radius: .4375rem; background: transparent; text-align: left; color: #3b3d42; }
.shop-option:hover { background: #dfdfe7; }
.shop-option.is-active { background: var(--accent); color: white; }
.shop-name { font-size: .75rem; }
.shop-count { color: #84878d; font-size: .6875rem; font-variant-numeric: tabular-nums; }
.shop-count.has-todo { color: #bb4429; font-weight: 650; }
.shop-option.is-active .shop-count { color: white; }
.directory-message { margin: .5rem 0 0; padding: .5rem .625rem; color: #7b7d83; font-size: .625rem; line-height: 1.7; }
.view-context { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin: 0 0 .875rem; }
.view-context .eyebrow { display: none; }
.view-context h2 { font-size: 1.125rem; }
#next-shop-btn { background: transparent; color: var(--accent); border-color: transparent; }
.banner { padding: .625rem .875rem; border-radius: .5rem; border: 1px solid; font-size: .6875rem; line-height: 1.7; }
.banner strong { font-weight: 620; margin-right: .75rem; }
.banner-ok { background: #edf6ef; color: #28663e; border-color: #d7e8dc; }
.banner-warn { background: #fff7e8; color: #835617; border-color: #efdfbf; }
.banner-bad { background: #fff1ef; color: #a33328; border-color: #f0d3ce; }
.banner-neutral { background: #eeeeF2; color: var(--muted); border-color: #e1e1e6; }
.notice { margin-top: .625rem; padding: .625rem .875rem; background: #eaf3ff; color: #185b9c; border-radius: .5rem; font-size: .75rem; }
.notice.error { background: #fff1ef; color: #a33328; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin: 1rem 0 1.125rem; }
.metric { padding: 0 1rem; border-left: 1px solid #ddddE3; }
.metric:first-child { padding-left: .25rem; border: 0; }
.metric-label { color: #777980; font-size: .6875rem; }
.metric-value { display: block; font-size: 1.5rem; line-height: 1.5; font-weight: 620; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.metric-detail { display: none; }
.tabs { display: flex; align-items: center; gap: .25rem; padding: .25rem; background: #e9e9ed; border: 0; border-radius: .625rem; width: fit-content; margin-bottom: .75rem; position: relative; z-index: 6; }
.tab { display: inline-flex; align-items: center; gap: .4375rem; padding: .4375rem .875rem; border: 0; border-radius: .4375rem; background: transparent; font-size: .75rem; color: #62646b; white-space: nowrap; }
.tab:hover { background: #ffffff60; }
.tab.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px #181b2617; font-weight: 600; }
.pill { min-width: 1rem; color: #7a7c84; font-size: .625rem; text-align: center; font-variant-numeric: tabular-nums; }
.tab.is-active .pill { color: var(--accent); }
.pill.has-count, .tab.is-active .pill.has-count { min-width: 1.25rem; padding: 0 .375rem; border-radius: 999px; background: #e5484d; color: #fff; font-size: .6875rem; font-weight: 700; line-height: 1.25rem; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
/* 分頁列分兩段：左邊待辦（不看日期），右邊依銷售日查詢；日期列只在查詢段出現 */
.tabs { flex-wrap: wrap; }
.tab-divider { width: 1px; height: 1.25rem; margin: 0 .375rem; background: #c9cad1; }
.tab-group-label { padding: 0 .25rem 0 .125rem; font-size: .625rem; color: #8a8c93; white-space: nowrap; }
.query-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: -.25rem 0 .75rem; }
.query-label { font-size: .75rem; color: var(--muted); }
@media (max-width: 720px) { .tab-divider { display: none; } .tab-group-label { flex-basis: 100%; padding: .25rem .5rem 0; } }
main { padding: 0; }
.panel { border: 1px solid var(--line); border-radius: .75rem; background: #fff; overflow: visible; }
#panel-list > .list-heading { display: none; }
.list-heading { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.list-heading p { margin: .3125rem 0 0; }
.search-toolbar { display: flex; align-items: center; gap: .5rem; padding: .75rem; }
.search-field { flex: 1; min-width: 12rem; }
.search-field input { width: 100%; border: 0; background: #f1f1f4; font-size: .75rem; }
.filter-disclosure { position: relative; }
.filter-disclosure > summary { white-space: nowrap; padding: .4375rem .625rem; font-size: .75rem; color: #60636b; border-radius: .375rem; }
.filters { position: absolute; right: 0; top: calc(100% + .5rem); display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; width: 23rem; padding: 1rem; background: #ffffffed; backdrop-filter: blur(22px); border: 1px solid #dedee4; border-radius: .75rem; box-shadow: 0 8px 32px #20202b20; z-index: 7; }
.filters label { display: grid; gap: .3125rem; color: #70727a; font-size: .6875rem; }
.filters select { width: 100%; font-size: .75rem; }
.list-toolbar { display: flex; align-items: center; gap: 1rem; padding: .4375rem .875rem; border-bottom: 1px solid #ececf0; color: var(--muted); font-size: .6875rem; }
.inline-check { display: inline-flex; gap: .375rem; align-items: center; margin-left: auto; }
.progress-text { color: #267047; }
.table-scroll { overflow: auto; max-height: 68vh; scrollbar-width: thin; border-radius: 0 0 .75rem .75rem; }
.work-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .75rem; }
.work-table th { position: sticky; top: 0; z-index: 2; background: #f9f9fb; border-bottom: 1px solid #ececf0; padding: .5625rem .625rem; color: #777a83; font-size: .625rem; font-weight: 550; text-align: left; white-space: nowrap; }
.work-table td { padding: .6875rem .625rem; border-bottom: 1px solid #efeff2; vertical-align: top; }
.work-table tr:last-child td { border: 0; }
.work-table tbody tr:hover { background: #f8faff; }
.work-table tr.recent { background: #eef8f1; }
.work-table tr.current { background: #f0f6ff; box-shadow: inset 2px 0 #0071e3; }
.serial { font-family: "SF Mono", SFMono-Regular, Menlo, Monaco, monospace; font-variant-numeric: slashed-zero tabular-nums; font-feature-settings: "zero" 1; font-size: .9375rem; font-weight: 600; letter-spacing: .035em; white-space: nowrap; }
.copy-value { display: flex; align-items: center; gap: .5rem; }
.copy-btn { min-height: 1.75rem; padding: .25rem .4375rem; border: 1px solid transparent; background: #f0f4f9; color: #2673ba; border-radius: .3125rem; font-size: .625rem; white-space: nowrap; }
.copy-btn:hover, .copy-btn.copied { background: #e0efff; border-color: #d0e3fa; }
.doc-id { font: .6875rem "SF Mono", SFMono-Regular, Menlo, Monaco, monospace; white-space: nowrap; user-select: all; }
.sale-date { margin-bottom: .3125rem; color: #5b6c87; font-size: .6875rem; font-variant-numeric: tabular-nums; }
.cell-sub { margin-top: .375rem; color: var(--muted); font-size: .6875rem; line-height: 1.65; }
.product-cell { min-width: 9rem; max-width: 15rem; }
.product-inline { max-width: 15rem; }
.status-cell { min-width: 8.5rem; max-width: 12rem; }
.badge { display: inline-block; padding: .125rem .4375rem; border-radius: .3125rem; font-size: .625rem; line-height: 1.6; }
.badge-missing { color: #ac492e; background: #fff0e9; }
.badge-pending { color: #917024; background: #fff6db; }
/* 序號由系統回抓：不是錯誤，但值得多看一眼 */
.badge-warn { color: #8a5a10; background: #fdf0d8; }
.status-cell .badge + .badge { margin-left: .25rem; }
.badge-done { color: #2a7746; background: #e9f6ed; }
.badge-info { color: #3e648b; background: #eef4fa; }
.badge-muted { color: #707780; background: #f0f1f3; }
.status-cell summary { margin-top: .3125rem; color: #858890; font-size: .625rem; }
.status-cell summary::before { content: '› '; }
.status-cell details[open] summary::before { content: '⌄ '; }
.row-actions { min-width: 7.75rem; }
.row-actions > button { width: 100%; }
.row-actions details { margin-top: .4375rem; }
.row-actions summary { color: #858890; font-size: .625rem; }
.row-actions details .ghost-btn { margin-top: .375rem; width: 100%; font-size: .6875rem; }
.detail-note { min-width: 10rem; max-width: 16rem; margin: .5rem 0; font-size: .6875rem; color: var(--muted); overflow-wrap: anywhere; }
.candidate { display: grid; gap: .4375rem; padding-top: .625rem; margin-top: .625rem; border-top: 1px solid var(--line); }
.candidate .serial { font-size: .75rem; }
.empty { padding: 2.5rem 1rem; text-align: center; line-height: 1.8; color: var(--muted); }
.foot { margin-top: 1rem; padding-bottom: 3.5rem; color: #898c93; font-size: .625rem; }
dialog { width: 28rem; padding: 1.5rem; border: 1px solid #e3e3e8; border-radius: 1rem; background: #fafafb; color: var(--ink); box-shadow: 0 20px 80px #10152436; }
dialog::backdrop { background: #15203640; }
dialog p { color: var(--muted); font-size: .75rem; line-height: 1.8; }
dialog label { display: grid; gap: .4375rem; font-size: .75rem; }
dialog label + label { margin-top: .875rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.5rem; }
.range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.range-fields input { width: 100%; }
.range-presets { display: flex; gap: .4375rem; margin-top: .875rem; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 20; border-radius: .625rem; padding: .6875rem 1rem; background: #272b34ed; backdrop-filter: blur(16px); color: white; font-size: .75rem; box-shadow: 0 6px 24px #1b1e2733; }
.trend { display: flex; overflow-x: auto; gap: .625rem; padding: 0 1rem 1rem; }
.trend-day { flex: 0 0 5.75rem; display: grid; gap: .375rem; padding: .75rem; background: #f7f8fb; border: 1px solid #e5e7ee; border-radius: .5rem; text-align: left; font-size: .6875rem; }
.trend-day strong { font-size: 1.25rem; }
.trend-day meter { width: 100%; height: .625rem; }
.trend-day small { color: var(--muted); }
.region-block { padding: 0 1rem 1rem; }
.region-head { display: flex; align-items: center; gap: .75rem; padding: .875rem 0; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1350px) { .app-shell { padding-inline: 1.25rem; } .manager-layout { grid-template-columns: 10.5rem minmax(0, 1fr); gap: 1rem; } .work-table td, .work-table th { padding-inline: .4375rem; } .row-actions { min-width: 6.75rem; } .status-cell { min-width: 7.5rem; } .manager-layout .serial { font-size: .875rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-transparency: reduce) { .date-controls, .filters, .toast { backdrop-filter: none; background: #fff; } .toast { background: #272b34; } }
@media (prefers-contrast: more) { :root { --muted: #424750; --line: #8d939c; } .shop-sidebar { background: #eeeeF3; } .banner, .panel, .date-controls, .filters { border-color: #8d939c; } }

.list-pagination { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .625rem .875rem; border-top: 1px solid var(--line); font-size: .6875rem; color: var(--muted); }
.list-pagination span { margin-right: auto; }
