﻿:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --danger: #b91c1c;
  --warn: #b45309;
  --ok: #047857;
  --sider: #0b1324;
  --sider-2: #121a2f;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: "Segoe UI", "Noto Sans TC", sans-serif; color: var(--ink); }
body { background: var(--bg); }
html.login-html { background: #0b1324; color-scheme: dark; }
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sider { background: linear-gradient(180deg, var(--sider), var(--sider-2)); color: #dbe4f0; padding: 20px 14px; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.brand span { display: block; font-size: 12px; color: #93a4c0; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; }
.logo-mark.sm { width: 34px; height: 34px; border-radius: 10px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: block; padding: 8px 12px; border-radius: 8px; color: #c5d0e2; }
.nav a.active, .nav a:hover { background: rgba(20,184,166,.16); color: #fff; }
.nav a.disabled { opacity: .38; pointer-events: none; cursor: default; }
.nav-label { margin: 14px 12px 6px; font-size: 11px; letter-spacing: .12em; color: #7f8eaa; text-transform: uppercase; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; display: grid; grid-template-columns: minmax(40px, 1fr) minmax(0, auto) minmax(0, 1fr); align-items: center; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); gap: 16px; }
.topbar-side { justify-self: start; }
.topbar-company { text-align: center; font-weight: 700; font-size: 22px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(52vw, 640px); }
.userbox { display: flex; gap: 14px; align-items: center; justify-self: end; min-width: 0; max-width: 100%; font-size: 16px; }
.userbox a { color: var(--brand); }
.userbox-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .plan-chip { flex: 1 1 auto; min-width: 0; }
.userbox .logout-link { flex: 0 0 auto; white-space: nowrap; }
.plan-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e !important;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-chip.readonly {
  background: #ffedd5;
  color: #9a3412 !important;
}
.plan-lock-banner {
  padding: 8px 24px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #fed7aa;
}
.plan-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0 8px;
  align-items: stretch;
}
.plan-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-card.featured { border-color: var(--brand); box-shadow: 0 10px 28px rgba(15,118,110,.12); }
.plan-card.current { background: #f0fdfa; }
.plan-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.plan-badge.current-badge { background: #0f766e; left: auto; right: 16px; }
.plan-card h2 { margin: 8px 0 0; font-size: 22px; }
.plan-tagline { margin: 0; color: var(--muted); font-size: 13px; min-height: 2.4em; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 8px; }
.plan-price b { font-size: 32px; letter-spacing: -0.03em; }
.plan-price span { color: var(--muted); }
.plan-feat { list-style: none; margin: 0 0 12px; padding: 0; flex: 1; }
.plan-feat li { position: relative; padding: 5px 0 5px 22px; font-size: 13px; }
.plan-feat li.ok::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan-feat li.no { color: var(--muted); }
.plan-feat li.no::before { content: "－"; position: absolute; left: 0; color: #94a3b8; }
.plan-card .btn[disabled] { opacity: .55; cursor: default; }
.plan-cancel { margin: 16px 0 8px; }
.plan-cancel h3 { margin: 0 0 8px; }
.plan-cancel p { margin: 0 0 12px; color: var(--muted); }
.plan-cancel .btn { min-width: 140px; }

@media (max-width: 1100px) {
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .plan-grid { grid-template-columns: 1fr; }
}
.online-count {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 5000;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  pointer-events: none;
  white-space: nowrap;
}
.online-count b { color: var(--brand); font-variant-numeric: tabular-nums; }
body.shell-page .online-count {
  top: 22px;
  left: 252px;
}
html.login-html .online-count,
body.login-body .online-count {
  color: #e2e8f0;
  background: rgba(15, 23, 42, .88);
  border-color: #334155;
}
html.login-html .online-count b,
body.login-body .online-count b { color: #5eead4; }
.menu-toggle { display: none; border: 0; background: #e2e8f0; border-radius: 10px; width: 40px; height: 40px; cursor: pointer; font-size: 18px; line-height: 1; }
.shell-overlay { display: none; }

body.shell-page { height: 100vh; height: 100dvh; overflow: hidden; }
body.shell-page > form { height: 100%; min-height: 0; }
body.shell-page .app-shell { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
body.shell-page .sider { min-height: 0; overflow-y: auto; }
body.shell-page .main { min-height: 0; height: 100%; overflow: hidden; }
body.shell-page .frame-wrap { flex: 1; min-height: 0; padding: 0; overflow: hidden; }
body.shell-page .frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.content { padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpis.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.kpi b { display: block; font-size: 26px; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ledger-card { margin-bottom: 14px; }
.ledger-card h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.ledger-card h3 b { margin-left: auto; font-size: 22px; }
.ledger-card > .muted { margin: 0 0 10px; }
.table-wrap { overflow-x: auto; }
a.doc-link { color: var(--brand); font-weight: 700; }
a.doc-link:hover { text-decoration: underline; }
.led-tag { font-size: 12px; font-weight: 700; }
.led-paid { color: var(--ok); }
.led-open { color: var(--warn); }
.led-over { color: var(--danger); }
.led-credit { color: var(--muted); }
.ledger-card tbody tr.led-return td { background: #fecaca !important; color: var(--ink) !important; }
.ledger-card tbody tr.led-return a.doc-link { color: var(--brand); }
.ledger-card tbody tr.led-return .led-tag { color: var(--ink); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.num input, input.num, input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }

.btn { border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer; background: #e2e8f0; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); color: #fff; }
.btn.block { width: 100%; padding: 12px; }
.btn.danger { background: var(--danger); color: #fff; }
a.btn { display: inline-flex; align-items: center; justify-content: center; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 0; }
.toolbar select.toolbar-io { width: auto; min-width: 7.5em; max-width: 9.5em; flex: 0 0 auto; }
.toolbar.v-query { flex-wrap: nowrap; width: fit-content; max-width: 100%; }
.toolbar.v-query > input[type="date"] { width: auto; flex: 0 0 10.5em; max-width: 11em; }
.toolbar.v-query > .btn { flex: 0 0 auto; white-space: nowrap; }

form.stack, .stack { display: grid; gap: 8px; }
label { font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input[readonly], select:disabled { background: #f8fafc; color: var(--muted); cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.settings-card { margin-bottom: 14px; }
.settings-card h3 { margin-top: 0; }
.settings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-grid .settings-wide { grid-column: 1 / -1; }
.settings-grid small { display: block; margin-top: 5px; color: var(--muted); }
.power-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.power-toolbar label { font-weight: 600; color: var(--ink); font-size: 14px; }
.power-toolbar .user-info { font-size: 16px; font-weight: 700; color: var(--ink); }
.power-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.power-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.power-grid-wrap { overflow: auto; margin-bottom: 4px; }
.power-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.power-grid th, .power-grid td {
  text-align: center;
  vertical-align: middle;
  padding: 10px 8px;
}
.power-grid th.title {
  background: linear-gradient(180deg, #ccfbf1 0%, #99f6e4 100%);
  color: #134e4a;
  font-weight: 700;
  width: 11%;
}
.power-grid th.title.mod { text-align: left; padding-left: 16px; width: 34%; }
.power-grid td.module-name {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  padding-left: 16px;
}
.power-grid tbody tr:nth-child(odd) td { background: #f0fdfa; }
.power-grid tbody tr:nth-child(even) td { background: #fff; }
.power-grid tbody tr:hover td { background: #ccfbf1 !important; }
.power-grid input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand);
  flex: 0 0 auto;
}
.line-table { width: 100%; margin-top: 4px; }
.line-table th { font-size: 13px; }
.line-table .col-qty, .line-table .col-price, .line-table .col-amt { width: 120px; }
.line-table .col-del { width: 72px; }
.line-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.line-foot strong { font-size: 16px; }
a.doc-no { color: var(--brand); font-weight: 700; }
a.doc-no:hover { text-decoration: underline; }
.alert { background: #fef2f2; color: var(--danger); padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.login-inapp { background: #fff7ed; color: #9a3412; padding: 12px; border-radius: 10px; margin: 10px 0 2px; font-size: 14px; line-height: 1.45; }
.login-inapp p { margin: 0 0 8px; }
.login-inapp .btn { margin-top: 4px; }
.okbox { background: #ecfdf5; color: var(--ok); padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e2e8f0; font-size: 12px; }
.muted { color: var(--muted); }
pre.json { white-space: pre-wrap; margin: 0; font-size: 13px; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 20%, #134e4a, #0b1324 55%); }
.login-shell { width: min(920px, calc(100% - 32px)); display: grid; grid-template-columns: 1.1fr .9fr; background: #0f172a; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-brand { padding: 48px 40px; color: #e2e8f0; }
.login-brand h1 { margin: 16px 0 8px; }
.login-brand p, .login-brand li { color: #94a3b8; }
.login-card { background: #fff; padding: 40px; display: grid; align-content: center; gap: 8px; color-scheme: light; }
.login-card h2 { margin: 0 0 8px; }
.google-signin-wrap { display: flex; justify-content: center; align-items: center; position: relative; z-index: 1; height: 44px; min-height: 44px; margin-top: 2px; overflow: hidden; isolation: isolate; }
.google-signin-wrap iframe { max-width: 100%; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; padding: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.password-toggle:hover, .password-toggle:focus { color: var(--ink); background: #f1f5f9; outline: none; }
.password-toggle svg { width: 20px; height: 20px; display: block; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 720px) {
  .app-shell, .kpis, .grid-2, .form-grid, .login-shell { grid-template-columns: 1fr; }
  .power-toolbar-actions { margin-left: 0; width: 100%; }
  .menu-toggle { display: grid; place-items: center; }
  body.shell-page .app-shell { grid-template-columns: 1fr; }
  body.shell-page .sider {
    position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 40;
    transform: translateX(-105%); transition: transform .2s ease;
  }
  body.shell-page .app-shell.nav-open .sider { transform: none; }
  body.shell-page .app-shell.nav-open ~ .shell-overlay {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 30;
  }
  body.shell-page .online-count { left: 58px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0 12px; gap: 10px; }
  .topbar-company { font-size: 18px; max-width: none; }
  .userbox { gap: 8px; }
  .userbox-name, .userbox .plan-chip { display: none; }
}

.so-page { display: flex; flex-direction: column; min-height: calc(100vh - 120px); }
.so-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.so-top h1 { margin: 0; font-size: 24px; }
.so-top p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.so-tools { display: flex; gap: 10px; }
.so-tool { width: 72px; height: 64px; border: 0; border-radius: 12px; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 13px; }
.so-tool svg { width: 26px; height: 26px; }
a.so-tool { text-decoration: none; }
.so-tool-new { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.so-tool-print { background: var(--sider); }
.so-tool-print-wrap { position: relative; }
.so-print-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 35;
  min-width: 112px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  overflow: hidden;
}
.so-print-menu.is-open { display: block; }
.so-print-menu[hidden] { display: none !important; }
.so-print-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
.so-print-menu button:hover { background: #f0fdfa; color: var(--brand); }
.so-tool-search { background: var(--ok); }
.so-tool-search.is-on { box-shadow: 0 0 0 3px rgba(4, 120, 87, .35); }
.so-qbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(6px);
  padding: 16px;
}
.so-qbox.is-open { display: flex; }
.so-qbox[hidden] { display: none !important; }
.so-qbox-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
  padding: 0;
  overflow: hidden;
}
.so-qbox-card > h2 { margin: 0 0 14px; font-size: 18px; padding: 18px 20px 0; }
.so-qbox-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 14px 20px;
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.so-qbox-head h2 { margin: 0; font-size: 18px; }
.so-qbox-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 400; }
.so-qbox-head > div { flex: 1; min-width: 0; }
.so-qbox-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.so-qbox-ico svg { width: 22px; height: 22px; display: block; }
.so-qbox-x {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}
.so-qbox-x:hover { background: #e2e8f0; color: var(--ink); }
.so-qbox-body { padding: 16px 20px 8px; }
.so-q-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.so-q-row label { font-weight: 700; color: var(--muted); }
.so-q-row input, .so-q-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.so-q-range { display: flex; align-items: center; gap: 8px; min-width: 0; }
.so-q-range > input, .so-q-range .so-date-wrap { flex: 1; min-width: 0; }
.so-q-range .so-date-wrap input { width: 100%; padding-right: 40px; }
.so-q-range span { color: var(--muted); flex: 0 0 auto; }
.so-q-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
  padding: 12px 20px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}
.so-pbox-card { max-width: 420px; }
.so-p-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.so-p-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  min-width: 0;
  position: relative;
}
.so-p-mode input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.so-p-mode:hover { border-color: #99f6e4; background: #f8fffd; }
.so-p-mode:has(input:checked),
.so-p-mode.is-on {
  border-color: var(--brand);
  background: #f0fdfa;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .16);
}
.so-p-mode-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #e2e8f0;
  color: var(--muted);
}
.so-p-mode:has(input:checked) .so-p-mode-ico,
.so-p-mode.is-on .so-p-mode-ico {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.so-p-mode-ico svg { width: 20px; height: 20px; display: block; }
.so-p-mode-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.so-p-mode-txt b { font-size: 15px; color: var(--ink); }
.so-p-mode-txt small { color: var(--muted); font-weight: 400; font-size: 12px; }
.so-p-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}
.so-p-check:hover { border-color: #99f6e4; background: #f0fdfa; }
.so-p-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--brand);
  cursor: pointer;
}
.so-p-check span { display: flex; flex-direction: column; gap: 2px; }
.so-p-check b { font-size: 14px; color: var(--ink); }
.so-p-check small { color: var(--muted); font-weight: 400; font-size: 12px; }
.so-desk { display: grid; grid-template-columns: 176px minmax(760px, 1fr); gap: 14px; flex: 1; min-height: 0; overflow: auto; }
.so-nav { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 520px; overflow: hidden; }
.so-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f8fafc; border-bottom: 1px solid var(--line); }
.so-tabs a { text-align: center; padding: 10px 6px; font-weight: 700; color: var(--muted); }
.so-tabs a.is-on { background: #fff; color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.so-nav-head { background: #cbd5e1; color: #1e293b; font-weight: 700; padding: 8px 12px; font-size: 16px; text-align: center; }
.so-nav-search { padding: 8px; border-bottom: 1px solid var(--line); }
.so-nav-search input { padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.so-nav-search input::placeholder { font-size: 11px; color: var(--muted); }
.so-nav-list { overflow: auto; flex: 1; background: #fff; }
.so-doc { display: block; padding: 10px 12px; font-family: Consolas, "Noto Sans TC", monospace; font-size: 16px; text-align: center; border-bottom: 1px solid var(--line); color: var(--ink); }
.so-doc:hover { background: #f0fdfa; }
.so-doc.is-on { background: var(--brand); color: #fff; font-weight: 700; }
.so-empty, .so-blank { padding: 24px 16px; color: var(--muted); text-align: center; }
.so-stage { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-width: 0; padding: 16px; }
.so-head { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.so-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 14px; }
.so-field.so-span { grid-column: auto; }
.so-field.so-span-2 { grid-column: span 2; }
.so-field label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.so-field label::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: 0 0 auto; }
.so-field input, .so-field select { padding: 7px 10px; border-radius: 10px; border-color: var(--line); background: #fff; }
.so-doctype, input.so-doctype { color: var(--danger); font-weight: 700; }
.so-grid-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 280px; overflow: auto; flex: 1; display: flex; flex-direction: column; }
.so-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.so-grid th { background: #f8fafc; color: var(--muted); font-weight: 700; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 16px; }
.so-grid td { padding: 8px; border-bottom: 1px solid var(--line); font-size: 16px; background: #fff; }
.so-grid tr.is-on td { background: #f0fdfa; }
.so-grid tr.is-on input, .so-grid tr.is-on select { background: #fff; }
.so-grid .col-code { width: 120px; }
.so-grid .col-name { width: auto; }
.so-grid .col-unit { width: 48px; }
.so-grid .num { text-align: right; width: 88px; }
.so-grid .col-note { width: 88px; }
.so-grid .col-del { width: 36px; text-align: center; }
.so-grid td.col-code { padding-left: 6px; padding-right: 6px; }
.so-grid .col-code select {
  width: 100%;
  min-width: 0;
  padding: 8px 26px 8px 8px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.so-grid .num input[type="number"] { -moz-appearance: textfield; padding-right: 8px; }
.so-grid .num input[type="number"]::-webkit-outer-spin-button,
.so-grid .num input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.so-grid .col-name, .so-grid .line-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-grid input, .so-grid select { padding: 8px 10px; border-radius: 8px; font-size: 16px; }
.so-field.so-add-slot { display: flex; align-items: flex-end; justify-content: flex-end; }
.so-date-wrap { position: relative; }
.so-date-wrap input { padding-right: 40px; }
.so-cal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; padding: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 8px; }
.so-cal-btn:hover { color: var(--brand); background: #f0fdfa; }
.so-cal-btn svg { width: 18px; height: 18px; display: block; }
.cal-pop { position: fixed; z-index: 90; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.16); padding: 10px; }
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cal-title { flex: 1; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink); }
.cal-nav { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #f1f5f9; cursor: pointer; color: var(--ink); font-size: 14px; }
.cal-nav:hover { background: #e2e8f0; }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-week { margin-bottom: 4px; }
.cal-week span { font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-week .sun, .cal-days .sun { color: var(--danger); }
.cal-days button { height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; }
.cal-days button:hover { background: #f0fdfa; }
.cal-days .today { box-shadow: inset 0 0 0 1px var(--brand); }
.cal-days .is-on { background: var(--brand); color: #fff; }
.cal-days .is-on.sun { color: #fff; }
.cal-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.cal-today { border: 0; background: transparent; color: var(--brand); font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.cal-today:hover { background: #f0fdfa; }
.so-x { width: 26px; height: 26px; border: 0; border-radius: 8px; background: var(--danger); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.so-x:disabled { opacity: .4; cursor: not-allowed; }
.so-add-line { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; width: 100%; border: 0; border-radius: 10px; padding: 8px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .04em; cursor: pointer; }
.so-add-line:hover { filter: brightness(1.06); }
.so-add-line:active { transform: translateY(1px); }
.so-add-line svg { width: 20px; height: 20px; display: block; }
.so-foot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 14px; margin-top: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px; align-items: start; }
.so-foot .so-field input, .so-foot .so-field select { min-height: 38px; }
.so-foot-gap { visibility: hidden; pointer-events: none; }
.so-red { color: var(--danger) !important; font-weight: 700; }
.so-actions { margin-top: 12px; }
.content:has(.so-page) { padding: 24px; }

.so-doc span { display: block; margin-top: 2px; font-size: 12px; font-family: inherit; opacity: .78; }
.so-doc.is-on span { opacity: 1; }

.rt-page .so-top h1 { color: #0f766e; }
.rt-page .so-nav {
  background: #ecfeff;
  border-color: #67e8f9;
}
.rt-page .so-nav-head {
  background: linear-gradient(135deg, #0e7490, #22d3ee);
  color: #fff;
}
.rt-page .so-nav-list { background: #f0fdfa; }
.rt-page .so-doc:hover { background: #cffafe; }
.rt-page .so-doc.is-on { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.rt-page .so-stage {
  background: linear-gradient(180deg, #f8fffd 0%, #fff 48%);
  border-color: #5eead4;
}
.rt-desk { grid-template-columns: 176px minmax(0, 1fr); }
.rt-stage { gap: 12px; }
.rt-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr .7fr .6fr;
  gap: 10px;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 10px 12px;
}
.rt-bar .so-field label { color: #9a3412; }
.rt-scan-field input {
  border-color: #fb923c;
  background: #fffbeb;
  font-weight: 700;
}
.rt-work { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; min-height: 0; flex: 1; }
.rt-catalog-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 420px; }
.rt-filter {
  margin-bottom: 8px;
  border-color: #2dd4bf;
  background: #f0fdfa;
}
.rt-filter:focus { border-color: #0d9488; box-shadow: 0 0 0 3px rgba(20, 184, 166, .22); outline: none; }
.rt-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  overflow: auto;
  flex: 1;
  align-content: start;
  background: linear-gradient(180deg, #ecfdf5, #f0fdfa);
  border: 1px solid #5eead4;
  border-radius: 12px;
  padding: 10px;
}
.rt-sku {
  text-align: left;
  border: 1px solid #99f6e4;
  border-left: 4px solid #14b8a6;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.rt-sku:nth-child(5n+2) { border-left-color: #f59e0b; background: linear-gradient(180deg, #fffbeb, #fff); }
.rt-sku:nth-child(5n+3) { border-left-color: #8b5cf6; background: linear-gradient(180deg, #f5f3ff, #fff); }
.rt-sku:nth-child(5n+4) { border-left-color: #f43f5e; background: linear-gradient(180deg, #fff1f2, #fff); }
.rt-sku:nth-child(5n+5) { border-left-color: #0ea5e9; background: linear-gradient(180deg, #f0f9ff, #fff); }
.rt-sku:hover { border-color: var(--brand); background: #ccfbf1; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15, 118, 110, .12); }
.rt-sku b { font-size: 14px; line-height: 1.3; }
.rt-sku span, .rt-sku em { font-size: 12px; color: var(--muted); }
.rt-sku em { color: var(--brand); font-style: normal; font-weight: 700; }
.rt-cart {
  background: linear-gradient(180deg, #fff1f2, #ffe4e6);
  border: 1px solid #fb7185;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rt-cart h3 { margin: 0 0 8px; color: #be123c; }
.rt-cart .so-grid { background: #fff; border: 1px solid #fecdd3; border-radius: 10px; overflow: hidden; }
.rt-cart .so-grid th { background: #ffe4e6; color: #9f1239; }
.rt-cart .line-code { display: block; font-size: 12px; }
.rt-sum {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 12px;
  background: #fff;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px;
}
.rt-pay-field {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 8px 10px;
}
.rt-pay-field label { color: #c2410c; font-weight: 800; }
.rt-pay-field input {
  font-size: 28px;
  font-weight: 800;
  background: #fff;
  border-color: #fb7185;
  color: #be123c;
}
.rt-pay {
  min-width: 160px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, #f97316, #e11d48);
  box-shadow: 0 6px 16px rgba(225, 29, 72, .28);
}
.rt-pay:hover { filter: brightness(1.06); }
.rt-receipt-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ecfeff, #f0fdfa);
  border: 1px solid #67e8f9;
  border-radius: 12px;
  padding: 12px;
}
.rt-receipt-top > div {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #a5f3fc;
}
.rt-receipt-top > div:nth-child(1) { border-color: #67e8f9; }
.rt-receipt-top > div:nth-child(2) { border-color: #5eead4; }
.rt-receipt-top > div:nth-child(3) { border-color: #fb7185; background: #fff1f2; }
.rt-receipt-top label { display: block; margin-bottom: 4px; }
.rt-receipt-top strong { font-size: 20px; }

.so-slip { display: none !important; }

@media (max-width: 720px) {
  .so-desk { grid-template-columns: 1fr; }
  .so-fields { grid-template-columns: 1fr; }
  .so-field.so-span-2 { grid-column: auto; }
  .so-foot { grid-template-columns: 1fr; }
  .so-foot-gap { display: none; }
  .so-nav { min-height: 180px; }
  .so-p-modes { grid-template-columns: 1fr; }
  .rt-bar, .rt-work, .rt-receipt-top, .rt-sum { grid-template-columns: 1fr; }
}
/* 專業傳票編輯（對齊 AccMaster） */
.v-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.v-toolbar .v-phrase { min-width: 160px; max-width: 240px; }
.v-lines tr.is-sel { background: #f0fdfa; }
.muted { color: var(--muted); }
.v-lines .col-dc { width: 100px; min-width: 96px; }
.v-lines .col-dc select { min-width: 88px; width: 100%; }
.v-lines .col-acct { width: 140px; min-width: 120px; position: relative; }
.v-lines .acct-name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.v-lines .acct-name.is-hint { color: #0f766e; }
.v-lines .acct-input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); }
.acct-suggest {
  position: absolute;
  z-index: 40;
  min-width: 280px;
  max-width: 420px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.acct-suggest[hidden] { display: none !important; }
.acct-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.acct-suggest button.is-active,
.acct-suggest button:hover {
  background: #ecfdf5;
  color: #0f766e;
}
.acct-suggest .code { font-weight: 600; margin-right: 8px; }
.acct-suggest .name { color: var(--muted); }
.v-lines .col-amt { width: 120px; max-width: 140px; }
.v-lines .col-amt input.num { width: 100%; padding-left: 8px; padding-right: 8px; }
.v-lines .col-del { width: 44px; text-align: center; }
.v-lines .btn-del-line { padding: 4px 8px; min-width: 0; font-size: 13px; }

/* 傳票頁按鈕美化 */
.v-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.v-page .btn:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
  transform: translateY(-1px);
}
.v-page .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.v-page .btn.primary {
  background: linear-gradient(180deg, #149688, var(--brand));
  color: #fff;
  border-color: #0f766e;
}
.v-page .btn.primary:hover { background: linear-gradient(180deg, #0f766e, #0d5f59); }
.v-page .btn.soft {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
}
.v-page .btn.soft:hover { background: #ccfbf1; border-color: #5eead4; }
.v-page .btn.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.v-page .btn.ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--brand);
}
.v-page .btn.danger {
  background: linear-gradient(180deg, #dc2626, var(--danger));
  color: #fff;
  border-color: #991b1b;
}
.v-page .btn.danger:hover { background: linear-gradient(180deg, #b91c1c, #991b1b); }
.v-page .form-actions .btn { min-width: 96px; }
.v-page .actions .btn {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 13px;
}
.v-page .v-lines .btn-del-line {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  border: 1px solid #fecaca;
  box-shadow: none;
  font-weight: 700;
}
.v-page .v-lines .btn-del-line:hover {
  background: #fef2f2;
  border-color: #f87171;
  transform: none;
}
.v-page .v-toolbar .btn { min-height: 36px; }
.v-page .toolbar.v-query .btn { min-height: 40px; padding-left: 18px; padding-right: 18px; }
.v-sum-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-weight: 700;
  text-align: right;
}
.v-sum-bar.ok { color: var(--ok); background: #ecfdf5; border-color: #a7f3d0; }
.v-sum-bar.bad { color: var(--danger); background: #fef2f2; border-color: #fecaca; }

/* 報表中心 */
.fin-shell { max-width: 1480px; margin: 0 auto; }
.fin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.fin-head h1 { margin: 3px 0 5px; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; }
.fin-head p { margin: 0; color: var(--muted); font-size: 15px; }
.fin-eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.fin-print { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.fin-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin-bottom: 12px; }
.fin-tab { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); color: var(--muted); transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.fin-tab::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; }
.fin-tab:hover { border-color: #99f6e4; background: #fff; transform: translateY(-1px); }
.fin-tab b { color: var(--ink); font-size: 15px; }
.fin-tab span { font-size: 12px; }
.fin-tab.is-active { border-color: #5eead4; background: #f0fdfa; box-shadow: 0 6px 16px rgba(15,118,110,.08); }
.fin-tab.is-active b, .fin-tab.is-active span { color: var(--brand); }
.fin-tab.is-active::after { background: var(--brand); }
.fin-filter { display: grid; grid-template-columns: minmax(155px, 210px) 28px minmax(155px, 210px) auto 1fr; align-items: end; gap: 10px; margin-bottom: 14px; padding: 14px 16px; }
.fin-filter.fin-filter-asof { grid-template-columns: minmax(155px, 210px) auto 1fr; }
.fin-filter.fin-filter-dept { grid-template-columns: minmax(140px, 180px) 28px minmax(140px, 180px) minmax(150px, 200px) auto 1fr; }
.fin-filter.fin-filter-sub { grid-template-columns: minmax(130px, 160px) 28px minmax(130px, 160px) minmax(110px, 140px) minmax(110px, 140px) minmax(140px, 180px) auto 1fr; }
.fin-filter label { display: grid; gap: 5px; font-weight: 700; color: #475569; }
.fin-filter label span { padding-left: 2px; }
.fin-filter input, .fin-filter select { min-height: 42px; }
.fin-filter input:disabled { color: #94a3b8; background: #f1f5f9; }
.fin-date-arrow { align-self: end; display: grid; place-items: center; height: 42px; color: #94a3b8; font-size: 18px; }
.fin-generate { min-height: 42px; padding: 10px 18px; font-weight: 800; }
.fin-filter-note { align-self: center; justify-self: end; color: var(--muted); font-size: 13px; }
.fin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.fin-metric { position: relative; overflow: hidden; padding: 17px 18px; }
.fin-metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #cbd5e1; }
.fin-metric > span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.fin-metric strong { display: block; margin: 7px 0 2px; font-size: clamp(23px, 2.2vw, 31px); line-height: 1.15; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.fin-metric small { color: #94a3b8; font-size: 12px; }
.fin-metric-primary { background: linear-gradient(135deg, #0f766e, #115e59); border-color: #115e59; color: #fff; }
.fin-metric-primary::before { background: #5eead4; }
.fin-metric-primary > span, .fin-metric-primary small { color: #ccfbf1; }
.fin-report { padding: 0; overflow: hidden; }
.fin-report-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 17px; border-bottom: 1px solid var(--line); }
.fin-report-head > div:first-child { display: flex; align-items: center; gap: 10px; }
.fin-report-mark { width: 9px; height: 30px; border-radius: 5px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.fin-report h2 { margin: 0; font-size: 20px; }
.fin-report-head small { display: block; margin-top: 3px; color: var(--muted); }
.fin-period { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: #334155; font-size: 14px; font-weight: 700; }
.fin-period span { color: var(--muted); font-size: 12px; font-weight: 400; }
.fin-table th, .fin-table td { padding: 12px 18px; }
.fin-table thead th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #475569; font-size: 12px; letter-spacing: .04em; }
.fin-table tbody tr:not(.fin-section-row):hover td { background: #f8fffd; }
.fin-table .fin-code { width: 150px; color: #64748b; font-family: Consolas, "Noto Sans TC", monospace; }
.fin-table .fin-account { color: #1e293b; font-weight: 600; }
.fin-table .num { min-width: 145px; }
.fin-section-row th { padding: 9px 18px; background: #ecfdf5; color: #0f766e; border-top: 1px solid #99f6e4; border-bottom-color: #a7f3d0; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.fin-total-row td { background: #f8fafc; font-weight: 800; border-top: 1px solid #cbd5e1; }
.fin-table tfoot th { padding: 14px 18px; background: #f1f5f9; color: var(--ink); border-top: 2px solid #cbd5e1; border-bottom: 0; font-size: 14px; }
.fin-empty { padding: 46px 20px !important; text-align: center; color: var(--muted); }
.fin-empty b, .fin-empty span { display: block; }
.fin-empty b { margin-bottom: 5px; color: #334155; font-size: 16px; }
.fin-empty span { font-size: 13px; }
.fin-footnote { display: flex; justify-content: space-between; gap: 16px; padding: 11px 18px; background: #f8fafc; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .fin-tabs { grid-template-columns: repeat(2, 1fr); }
  .fin-filter, .fin-filter.fin-filter-dept, .fin-filter.fin-filter-sub { grid-template-columns: 1fr 28px 1fr auto; }
  .fin-filter-note { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 600px) {
  .fin-shell { padding: 18px 14px; }
  .fin-head { align-items: flex-start; }
  .fin-head h1 { font-size: 25px; }
  .fin-head p { font-size: 14px; }
  .fin-print { padding: 9px 11px; white-space: nowrap; }
  .fin-tabs { gap: 6px; }
  .fin-tab { padding: 11px 12px; }
  .fin-filter, .fin-filter.fin-filter-dept, .fin-filter.fin-filter-sub, .fin-filter.fin-filter-asof { grid-template-columns: 1fr; }
  .fin-date-arrow { display: none; }
  .fin-generate { width: 100%; }
  .fin-summary { grid-template-columns: 1fr; gap: 8px; }
  .fin-metric { padding: 14px 16px; }
  .fin-report-head { align-items: flex-start; padding: 16px; }
  .fin-period { align-items: flex-end; text-align: right; }
  .fin-table th, .fin-table td { padding: 11px 12px; }
  .fin-table .fin-code { width: 112px; }
  .fin-table .num { min-width: 120px; }
  .fin-footnote { flex-direction: column; gap: 3px; }
}

@media print {
  body.fin-page { background: #fff; }
  body.fin-page .content { max-width: none; padding: 0; }
  .fin-head { margin-bottom: 14px; }
  .fin-head h1 { font-size: 24px; }
  .fin-summary { gap: 8px; }
  .fin-metric { break-inside: avoid; box-shadow: none; }
  .fin-metric-primary { color: #0f172a; background: #fff; border-color: #94a3b8; }
  .fin-metric-primary > span, .fin-metric-primary small { color: #64748b; }
  .fin-report { border-color: #94a3b8; }
  .fin-table thead th { position: static; }
  .fin-footnote { background: #fff; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  form#form1, .content, .so-page, .so-qbox { display: none !important; }
  body.rpt-page form#form1,
  body.rpt-page .content,
  body.fin-page form#form1,
  body.fin-page .content { display: block !important; }
  .online-count { display: none !important; }
}
