:root {
    --bg: #f3f6f4;
    --surface: #ffffff;
    --line: #dfe6e2;
    --text: #18201c;
    --muted: #66736c;
    --primary: #1f7a5b;
    --primary-strong: #155f47;
    --sidebar: #13211a;
    --sidebar-soft: #1d3328;
    --sidebar-line: rgba(255, 255, 255, 0.08);
    --danger-bg: #fff1f1;
    --danger: #9f2d2d;
    --success-bg: #edf8f1;
    --success: #226a43;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
    font-size: 15px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: clip;
}

.guest-shell {
    display: block;
}

.guest-shell .main {
    width: 100vw;
    max-width: none;
    padding: 0;
}

.guest-shell .content-area {
    width: 100vw;
    max-width: none;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: auto;
    min-width: 0;
    height: 100vh;
    background: var(--sidebar);
    color: #fff;
    padding: 24px 20px;
    overflow-y: auto;
}

/* 行動版頂列(漢堡按鈕),桌機不顯示。 */
.mobile-bar {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

.brand,
.auth-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--sidebar-line);
    margin-bottom: 20px;
}

.brand-text {
    min-width: 0;
}

.brand strong,
.auth-heading h1 {
    display: block;
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

.brand span {
    display: block;
    color: #b6c4bd;
    font-size: 13px;
    margin-top: 3px;
}

.brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.nav-section-title {
    display: block;
    padding: 0 10px 4px;
    color: #c3d2ca;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .06em;
    white-space: nowrap;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #d9e4df;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.nav a span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav a:hover,
.nav a.active {
    background: var(--sidebar-soft);
    color: #fff;
}

.nav-icon {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #d9efe6;
    font-size: 13px;
    font-weight: 700;
}

.nav a.active .nav-icon {
    background: var(--primary);
    color: #fff;
}

.main {
    min-width: 0;
    max-width: 100%;
    padding: 30px clamp(20px, 2.4vw, 34px) 46px;
    overflow-x: hidden;
}

.content-area {
    display: grid;
    gap: 18px;
    width: 100%;
    min-width: 0;
    max-width: 1280px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-bottom: 22px;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.25;
}

.page-title span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.account {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.account small {
    color: var(--muted);
}

.account-name {
    font-weight: 600;
}

.panel,
.stat-card,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    min-width: 0;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(24, 32, 28, 0.04);
}

.panel.narrow {
    max-width: 760px;
}

.panel.subtle {
    background: var(--surface-2, #f6f8f7);
    border: 1px solid var(--line, #e2e8e5);
}

.field-hint {
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
    margin-left: 4px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

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

.panel-header p {
    margin: 8px 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    gap: 14px;
    margin-bottom: 0;
    min-width: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.stat-card,
.feature-card {
    min-width: 0;
    padding: 18px;
}

.stat-card span,
.feature-card span {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 30px;
}

.stat-card strong.text-fit {
    display: block;
    overflow-wrap: anywhere;
    font-size: 20px;
    line-height: 1.3;
}

.feature-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.feature-card strong {
    display: block;
    font-size: 17px;
    line-height: 1.45;
}

.module-card {
    display: block;
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(24, 32, 28, 0.04);
}

.module-card:hover {
    border-color: rgba(31, 122, 91, 0.42);
    box-shadow: 0 8px 18px rgba(24, 32, 28, 0.08);
}

.module-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.module-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 10px;
}

.module-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.table-wrap {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

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

.actions form {
    margin: 0;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.table-actions form {
    margin: 0;
}

.table-actions .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 14px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

.btn.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.btn.primary:hover {
    background: var(--primary-strong);
}

.btn.ghost {
    background: transparent;
}

.btn.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 14px;
}

.btn.danger {
    border-color: #c0392b;
    color: #c0392b;
    background: transparent;
}

.btn.danger:hover {
    background: #c0392b;
    color: #fff;
}

.btn.full {
    width: 100%;
}

.form {
    display: grid;
    gap: 14px;
}

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

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

label span {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(31, 122, 91, 0.2);
    border-color: var(--primary);
}

.search {
    display: flex;
    gap: 8px;
    width: min(420px, 100%);
}

.bank-filter {
    width: min(720px, 100%);
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert.success {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid #bfe7ca;
}

.alert.error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #f2c1c1;
}

.alert.warning {
    color: #946200;
    background: #fff7db;
    border: 1px solid #f4d27b;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 13px;
}

.badge.ok {
    color: var(--success);
    background: var(--success-bg);
}

.badge.muted {
    color: var(--muted);
    background: #eef2ef;
}

.badge.warning {
    color: #946200;
    background: #fff7db;
}

.badge.danger {
    color: var(--danger);
    background: var(--danger-bg);
}

.danger-text {
    color: var(--danger);
    font-weight: 700;
}

.empty,
.muted-text {
    color: var(--muted);
}

.mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.auth-panel {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 28px;
    align-items: center;
    width: 100vw;
    min-height: 100vh;
    padding: 48px;
    background:
        linear-gradient(135deg, rgba(19, 33, 26, .96), rgba(31, 122, 91, .88)),
        #13211a;
}

.login-shell > * {
    min-width: 0;
}

.login-intro {
    max-width: 820px;
    color: #fff;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 44px;
}

.login-brand h1,
.login-copy h2,
.login-card h2 {
    margin: 0;
}

.login-brand h1 {
    font-size: 28px;
    line-height: 1.25;
}

.login-brand .eyebrow,
.login-copy p,
.login-built-by {
    color: rgba(255, 255, 255, .78);
}

.login-copy {
    max-width: 720px;
    margin-bottom: 28px;
}

.login-copy h2 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
}

.login-copy p {
    margin: 18px 0 0;
    font-size: 17px;
    line-height: 1.8;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 760px;
}

.login-feature-grid div {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.login-feature-grid strong,
.login-feature-grid span {
    display: block;
}

.login-feature-grid strong {
    margin-bottom: 6px;
    font-size: 16px;
}

.login-feature-grid span {
    color: rgba(255, 255, 255, .74);
    line-height: 1.6;
}

.login-built-by {
    margin: 28px 0 0;
    font-weight: 700;
}

.auth-card {
    width: min(420px, calc(100vw - 32px));
    padding: 26px;
}

.login-card {
    justify-self: end;
    width: min(430px, 100%);
    padding: 30px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
}

.auth-heading {
    margin-bottom: 22px;
}

.login-card .auth-heading {
    align-items: flex-start;
}

.login-card .eyebrow {
    margin-bottom: 6px;
}

.login-security-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.captcha-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.captcha-row strong {
    display: grid;
    place-items: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f6f8f7;
    font-size: 20px;
    letter-spacing: .12em;
}

.login-remember {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    cursor: pointer;
}

.login-remember input {
    width: auto;
    margin: 2px 0 0;
    flex: none;
}

.text-link {
    color: var(--primary);
    text-align: center;
}

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

.page-tools {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 18px;
}

.update-summary {
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}

.ops-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ops-bar h2 {
    margin: 0;
    font-size: 18px;
}

.ops-bar p {
    margin: 6px 0 0;
}

.ops-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ops-actions form {
    margin: 0;
}

.release-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.release-box h3 {
    margin: 6px 0;
    font-size: 20px;
}

.release-box p {
    margin: 0 0 8px;
    color: var(--muted);
}

.release-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.release-actions form {
    margin: 0;
}

.budget-summary {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.budget-lines {
    display: grid;
    gap: 12px;
}

.budget-line {
    display: grid;
    grid-template-columns: 150px 180px 1fr 150px 44px;
    gap: 10px;
    align-items: end;
}

.nonprofit-line {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.work-plan-line {
    grid-template-columns: 120px 180px minmax(260px, 1fr) 180px 140px 64px;
}

.span-wide {
    min-width: 0;
}

.budget-line .btn {
    width: 44px;
    padding: 0;
}

.nonprofit-line .btn,
.work-plan-line .btn {
    width: auto;
}

.budget-editor-header {
    align-items: flex-end;
}

.flexible-budget-lines {
    gap: 16px;
}

.budget-line-toolbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 4px;
}

.budget-line-toolbar .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.budget-line-toolbar .btn {
    min-height: 34px;
    padding: 0 10px;
}

.budget-line .danger {
    border-color: #f3c7c7;
    color: #b42318;
}

.hidden {
    display: none !important;
}

.voucher-lines {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.voucher-line {
    display: grid;
    grid-template-columns: minmax(190px, 1.1fr) minmax(220px, 1.4fr) minmax(110px, .7fr) minmax(110px, .7fr) 64px;
    gap: 10px;
    align-items: end;
    min-width: 0;
}

.voucher-line-head {
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.voucher-line .btn {
    width: 64px;
}

.voucher-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.voucher-balance {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-weekday,
.calendar-day {
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.calendar-weekday:nth-child(7n),
.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-weekday {
    padding: 10px;
    background: #f6f8f7;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.calendar-day {
    min-height: 132px;
    padding: 9px;
    background: #fff;
}

.calendar-day.outside {
    background: #f8faf9;
    color: var(--muted);
}

.calendar-date {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-date span {
    color: var(--muted);
    font-size: 11px;
}

.calendar-events {
    display: grid;
    gap: 5px;
}

.calendar-event,
.calendar-more {
    display: block;
    min-width: 0;
    padding: 5px 7px;
    border-radius: 6px;
    background: #eef6f2;
    color: #155f47;
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event span {
    margin-right: 4px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.calendar-event.deadline {
    background: #fff4df;
    color: #765014;
}

.calendar-event.leave {
    background: #eef2ff;
    color: #31436d;
}

.calendar-event.cancelled,
.calendar-event.other {
    background: #eef2ef;
    color: var(--muted);
}

/* 外部(Google 等)日曆事件:唯讀,以左側色條標示來源顏色。 */
.calendar-event.external {
    background: #f4f6f8;
    color: #2a3138;
    border-left: 3px solid #4285f4;
    cursor: default;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 12px 0 4px;
    font-size: 13px;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.calendar-more {
    background: transparent;
    color: var(--muted);
}

.checkbox-field {
    align-self: end;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.inline-check input {
    width: 18px;
    min-height: 18px;
}

.inline-check span {
    margin: 0;
    color: var(--text);
}

.calc-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf9;
}

.calc-summary span {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.release-notes {
    margin-top: 14px;
}

.release-notes summary {
    cursor: pointer;
    color: var(--primary);
}

.release-notes pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 14px;
    border-radius: 8px;
    background: #f6f8f7;
    color: var(--text);
    font: inherit;
}

.steps {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
}

.steps li {
    color: var(--muted);
}

.steps li.done {
    color: var(--success);
    font-weight: 600;
}

.print-document-header {
    display: none;
    text-align: center;
    margin-bottom: 18px;
}

.print-document-header h2,
.print-document-header h3 {
    margin: 0;
}

.print-document-header h2 {
    font-size: 22px;
}

.print-document-header h3 {
    margin-top: 8px;
    font-size: 18px;
}

.print-logo {
    display: block;
    max-height: 64px;
    max-width: 220px;
    width: auto;
    margin: 0 auto 6px;
    object-fit: contain;
}

.print-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.meta-table th {
    width: 150px;
    background: #f6f8f7;
}

.meta-table td {
    white-space: normal;
    line-height: 1.6;
}

.logo-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo-field__label {
    font-weight: 600;
    color: var(--text, inherit);
}

.logo-field__preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border, #d8dee9);
    border-radius: 8px;
    background: #fff;
    max-width: 260px;
}

.logo-field__preview img {
    max-height: 72px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
}

.logo-field__remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.logo-field__remove input {
    width: auto;
    margin: 0;
}

.logo-field__hint {
    color: var(--muted);
    font-size: 12px;
}

.two-column-report {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.two-column-report h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.report-total-table {
    margin-top: 18px;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 18px;
    margin-top: 34px;
}

.signature-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.signature-box .signature-role {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

/* 蓋章位置:留框供實體用印。 */
.signature-box .signature-stamp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 130px;
    height: 72px;
    border: 1px dashed #c4ccc8;
    border-radius: 6px;
    color: #b7c0bc;
    font-size: 12px;
    letter-spacing: 2px;
}

.signature-box .signature-name {
    display: block;
    margin-top: 8px;
    min-height: 22px;
    font-weight: 700;
}

.print-notes {
    line-height: 1.7;
}

.print-only {
    display: none;
}

.checkbox-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.checkbox-label input {
    width: auto;
}

/* 連線來源管制:三段模式的單選列(避免全域 input{width:100%} 撐開單選鈕)。 */
.access-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
}
.access-mode-option:last-child {
    margin-bottom: 0;
}
.access-mode-option input[type="radio"] {
    width: auto;
    min-height: 0;
    flex: 0 0 auto;
    margin: 3px 0 0;
}
.access-mode-option .access-mode-text {
    flex: 1;
    min-width: 0;
}
.access-mode-option .access-mode-text strong {
    display: block;
    margin-bottom: 2px;
    color: var(--text);
}
.access-mode-option .access-mode-text span {
    margin-bottom: 0;
}

.budget-statement {
    max-width: 100%;
}

.statement-title {
    text-align: center;
    margin-bottom: 14px;
}

.statement-title h2,
.statement-title h3,
.statement-title p {
    margin: 0 0 6px;
}

.receipt-batch {
    display: grid;
    gap: 18px;
}

.receipt-page {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.receipt-page .statement-title {
    margin-bottom: 18px;
}

.receipt-table {
    margin-top: 12px;
}

/* 官方樣式捐贈收據(可列印後蓋大小章) */
.official-receipt {
    max-width: 18cm;
    margin: 0 auto;
    padding: 12mm 12mm 10mm;
    color: #000000;
    background: #ffffff;
    border: 1px solid #333333;
    border-radius: 6px;
    font-family: "DFKai-SB", "BiauKai", "標楷體", "KaiTi", "TW-Kai", "Noto Serif TC", "PMingLiU", serif;
    line-height: 1.9;
}

.official-receipt .rc-head {
    text-align: center;
    margin-bottom: 10px;
}

.official-receipt .rc-org-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.official-receipt .rc-logo {
    height: 40px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
}

.official-receipt .rc-org {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}

.official-receipt .rc-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 12px;
    margin: 4px 0 10px;
}

.official-receipt .rc-datno {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #000000;
    padding-bottom: 4px;
    margin-bottom: 12px;
    font-size: 15px;
}

.official-receipt .rc-no {
    letter-spacing: 1px;
}

.official-receipt .rc-recital {
    font-size: 16px;
    margin: 8px 0 12px;
}

.official-receipt .rc-recital-line {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 2px;
}

.official-receipt .rc-recital-line + .rc-recital-line {
    margin-top: 6px;
}

.official-receipt .rc-fill {
    display: inline-block;
    min-width: 180px;
    border-bottom: 1px solid #000000;
    text-align: center;
    padding: 0 6px;
    font-weight: 700;
}

/* 捐贈人欄位:填滿該行剩餘寬度,姓名長短皆整齊。 */
.official-receipt .rc-fill-donor {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.official-receipt .rc-fill-sm {
    min-width: 110px;
    font-weight: 400;
}

.official-receipt .rc-fill-long {
    min-width: 60%;
}

.official-receipt .rc-body {
    border: 1px solid #000000;
    padding: 10px 14px;
    margin: 10px 0;
}

.official-receipt .rc-row {
    font-size: 16px;
    margin: 4px 0;
}

.official-receipt .rc-check {
    font-weight: 700;
    margin-right: 2px;
}

.official-receipt .rc-amount-cn {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
}

.official-receipt .rc-nt {
    font-weight: 700;
    letter-spacing: 1px;
}

.official-receipt .rc-thanks {
    font-size: 16px;
    margin: 14px 0 22px;
}

.official-receipt .rc-stamps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-top: 8px;
}

.official-receipt .rc-stamp-org {
    text-align: center;
}

.official-receipt .rc-stamp-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.official-receipt .rc-stamp-box {
    display: block;
    width: 4.8cm;
    height: 4.8cm;
    border: 1px dashed #999999;
    border-radius: 4px;
}

.official-receipt .rc-stamp-people {
    font-size: 15px;
    line-height: 2.6;
    min-width: 42%;
    padding-top: 4px;
}

.official-receipt .rc-stamp-line {
    white-space: nowrap;
}

.official-receipt .rc-stamp-space {
    display: inline-block;
    min-width: 120px;
    border-bottom: 1px solid #000000;
}

.official-receipt .rc-stamp-seal {
    min-width: 70px;
    border-bottom: 0;
}

.official-receipt .rc-chairman {
    font-weight: 700;
    padding: 0 6px;
}

.official-receipt .rc-footer {
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px solid #000000;
    font-size: 12.5px;
    line-height: 1.7;
    text-align: center;
    color: #222222;
}

/* 董事會議議程／紀錄列印版面 */
.board-meeting-print {
    max-width: 18cm;
    margin: 0 auto 24px;
    padding: 8mm 10mm;
    color: #000000;
    background: #ffffff;
    font-family: "DFKai-SB", "BiauKai", "標楷體", "KaiTi", "TW-Kai", "Noto Serif TC", "PMingLiU", serif;
    line-height: 1.9;
}

.bm-doc-title {
    margin: 0;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.bm-doc-subtitle {
    margin: 4px 0 0;
    text-align: center;
    font-size: 15px;
    font-weight: 400;
}

.bm-body {
    margin: 18px 0 0;
    padding-left: 2.2em;
    font-size: 16px;
    list-style: none;
    counter-reset: bm-section;
}

.bm-body > li {
    margin-bottom: 10px;
    counter-increment: bm-section;
}

.bm-body > li::before {
    content: counter(bm-section, cjk-ideographic) "、";
    display: inline-block;
    width: 2.2em;
    margin-left: -2.2em;
    text-align: left;
}

.bm-agenda-item {
    margin: 10px 0 10px 1em;
    padding: 4px 0 4px 14px;
    border-left: 2px solid #b8b8b8;
}

/* 案由／說明／擬辦／決議:標籤固定 4 全形字寬靠左,內容自標籤後對齊。 */
.bm-clause {
    display: flex;
    align-items: baseline;
    margin: 3px 0;
}

.bm-clause-label {
    flex: 0 0 4em;
    white-space: nowrap;
}

.bm-clause-body {
    flex: 1 1 auto;
    min-width: 0;
}

.bm-clause-body p {
    margin: 0;
}

/* 內文多點:「一、二、三…」續行對齊該點文字(懸掛縮排)。 */
.bm-clause-body p.is-numbered {
    padding-left: 2em;
    text-indent: -2em;
}

/* 內文多點:「（一）（二）…」續行對齊。 */
.bm-clause-body p.is-bracket {
    padding-left: 2.6em;
    text-indent: -2.6em;
}

.bm-multiline {
    display: inline-block;
    vertical-align: top;
}

.bm-signatures {
    margin-top: 28px;
    text-align: right;
    font-size: 16px;
}

.bm-signature-line {
    margin: 6px 0;
}

.bm-signature-space {
    display: inline-block;
    min-width: 140px;
    border-bottom: 1px solid #000000;
}

.bm-signin-meta {
    margin: 16px 0 12px;
    font-size: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 40px;
}

.bm-signin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.bm-signin-table th,
.bm-signin-table td {
    border: 1px solid #000000;
    padding: 8px 10px;
    height: 32px;
    text-align: center;
}

.bm-signin-table th {
    background: #f0f0f0;
    font-weight: 700;
}

.bm-attachment-page {
    break-before: page;
    page-break-before: always;
}

.bm-attachment-caption {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
}

.bm-attachment-img {
    display: block;
    max-width: 100%;
    max-height: 250mm;
    margin: 0 auto;
}

/* 陳報主管機關公文(函)列印版面 */
.official-letter {
    position: relative;
    max-width: 18cm;
    margin: 0 auto 24px;
    padding: 14mm 20mm 16mm 16mm;
    color: #000000;
    background: #ffffff;
    font-family: "DFKai-SB", "BiauKai", "標楷體", "KaiTi", "TW-Kai", "Noto Serif TC", "PMingLiU", serif;
    line-height: 2;
}

.official-letter .ol-org-seal {
    position: absolute;
    top: 12mm;
    right: 4mm;
    writing-mode: vertical-rl;
    letter-spacing: 4px;
    font-size: 13px;
    color: #b00020;
    border: 1px solid #b00020;
    border-radius: 2px;
    padding: 8px 4px;
    opacity: 0.85;
}

.official-letter .ol-head {
    text-align: center;
    margin-bottom: 16px;
}

.official-letter .ol-org {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.official-letter .ol-address {
    text-align: right;
    font-size: 13px;
    line-height: 1.7;
    color: #222222;
    margin: 0 44px 0 0;
}

.official-letter .ol-address p {
    margin: 0;
}

.official-letter .ol-meta {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
    margin: 16px 0;
    font-size: 15px;
}

.official-letter .ol-meta th,
.official-letter .ol-meta td {
    border: none;
    padding: 6px 10px;
    text-align: left;
    font-weight: 400;
    vertical-align: top;
}

.official-letter .ol-meta th {
    width: 15%;
    white-space: nowrap;
    color: #333333;
}

.official-letter .ol-subject {
    font-size: 16px;
    margin: 16px 0;
}

.official-letter .ol-label {
    font-weight: 700;
}

.official-letter .ol-body {
    font-size: 16px;
    margin: 16px 0 44px;
}

.official-letter .ol-basis {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.official-letter .ol-basis > li {
    margin: 8px 0;
}

.official-letter .ol-attachments {
    list-style: none;
    margin: 4px 0 4px 2em;
    padding: 0;
}

.official-letter .ol-attachments > li {
    margin: 4px 0;
}

.official-letter .ol-signature {
    text-align: right;
    font-size: 16px;
    margin-top: 44px;
}

.official-letter .ol-signer-name {
    display: inline-block;
    min-width: 90px;
    font-weight: 700;
    border-bottom: 1px solid #000000;
    padding: 0 6px 3px;
    margin-right: 10px;
}

.official-letter .ol-copies {
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid #000000;
    font-size: 14px;
    line-height: 1.9;
}

.official-letter .ol-copies p {
    margin: 2px 0;
}

/* 陳報公文表單:附件快速帶入器 */
.doc-picker {
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--surface-muted, rgba(127, 127, 127, 0.06));
}

.doc-picker-title {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted, #666666);
}

.doc-picker-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0;
}

.doc-picker-group-name {
    flex: 0 0 auto;
    min-width: 6.5em;
    padding-top: 4px;
    font-size: 13px;
    font-weight: 600;
}

.doc-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doc-picker-chips .doc-chip {
    font-size: 12.5px;
}

.statement-table {
    min-width: 1180px;
    border-collapse: collapse;
}

.statement-table th,
.statement-table td {
    border: 1px solid var(--line);
    vertical-align: top;
}

.statement-table th {
    text-align: center;
}

.statement-table .statement-section td,
.statement-table .statement-group td,
.statement-table .statement-total td {
    font-weight: 700;
    background: #f6f8f7;
}

.statement-table .statement-subtotal td {
    font-weight: 700;
}

/* 收支營運表:段落標題、合計與稅前/稅後賸餘列 */
.operating-statement-table .os-section td {
    font-weight: 700;
    background: #f6f8f7;
}

.operating-statement-table .os-total td {
    font-weight: 700;
    border-top: 1px solid var(--line);
}

.operating-statement-table .os-grand td {
    font-weight: 700;
    background: #eef2f1;
    border-top: 2px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.financial-statement-table .statement-section td,
.financial-statement-table .statement-section {
    background: #f6f8f7;
    font-weight: 700;
}

.activity-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin: 16px 0;
}

.compact-form {
    margin-top: 12px;
}

.compact-form textarea {
    min-height: 72px;
}

.recon-form {
    display: grid;
    grid-template-columns: 120px 140px minmax(160px, 1fr) 64px;
    gap: 8px;
    min-width: 520px;
}

.purchase-lines-editor {
    display: grid;
    gap: 12px;
}

.purchase-line {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfcfb;
}

.purchase-line-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1.5fr) minmax(160px, 1.5fr) 90px 110px 120px minmax(140px, 1fr) 64px;
    gap: 10px;
    align-items: end;
}

.purchase-detail {
    display: grid;
    gap: 18px;
    align-content: start;
}

.board-meeting-lines {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.board-meeting-line {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfcfb;
}

.board-meeting-line-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1.5fr) 160px 160px 64px;
    gap: 10px;
    align-items: end;
}

.board-meeting-agenda-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 64px;
}

.purchase-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 260px) auto;
    align-items: start;
    gap: 18px;
    border-color: #d8e6df;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbf9 100%);
}

.purchase-detail-title {
    min-width: 0;
    max-width: 760px;
}

.purchase-title-row,
.purchase-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.purchase-title-row {
    margin-bottom: 10px;
}

.purchase-detail-title h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.purchase-hero-meta {
    margin-top: 10px;
    color: var(--muted);
}

.purchase-hero-meta span:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 12px;
    margin-left: 12px;
    background: var(--line);
    vertical-align: -1px;
}

.purchase-hero-insight {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #d8e6df;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
}

.purchase-hero-insight span,
.purchase-hero-insight small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.purchase-hero-insight strong {
    display: block;
    margin: 5px 0;
    color: var(--primary-strong);
    font-size: 17px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.purchase-detail-actions {
    justify-content: flex-end;
    max-width: 260px;
}

.purchase-detail-actions form {
    margin: 0;
}

.purchase-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.purchase-summary-tile {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(24, 32, 28, 0.04);
}

.purchase-summary-primary {
    border-color: #c9ddd4;
    background: #f7fbf9;
}

.purchase-summary-vendor {
    grid-column: span 2;
}

.purchase-summary-tile span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.purchase-summary-tile strong {
    display: block;
    min-width: 0;
    font-size: 24px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.purchase-summary-primary strong {
    color: var(--primary-strong);
    font-size: 26px;
}

.purchase-summary-tile strong.text-fit {
    font-size: 18px;
    line-height: 1.4;
}

.purchase-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 16px;
    align-items: start;
}

.purchase-detail-main,
.purchase-detail-sidebar {
    min-width: 0;
}

.purchase-detail-sidebar {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 18px;
}

.purchase-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 14px;
}

.purchase-section-heading h3 {
    margin: 0;
    font-size: 18px;
}

.purchase-section-heading p {
    margin: 4px 0 0;
}

.purchase-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    padding-top: 4px;
}

.purchase-info-block h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.purchase-field-list {
    margin: 0;
}

.purchase-field-list div {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.purchase-field-list dt {
    color: var(--muted);
    font-weight: 600;
}

.purchase-field-list dd {
    min-width: 0;
    margin: 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.purchase-narrative-list {
    display: grid;
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.purchase-narrative-list section {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.purchase-narrative-list h3 {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.purchase-narrative-list p {
    min-width: 0;
    margin: 0;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.purchase-lines-heading {
    margin-top: 20px;
}

.purchase-lines-table {
    min-width: 880px;
}

.purchase-lines-table th,
.purchase-lines-table td {
    white-space: normal;
}

.purchase-lines-table .purchase-col-index {
    width: 52px;
}

.purchase-lines-table .purchase-col-name {
    width: 25%;
}

.purchase-lines-table .purchase-col-spec {
    width: 28%;
}

.purchase-lines-table .purchase-col-qty,
.purchase-lines-table .purchase-col-price,
.purchase-lines-table .purchase-col-amount {
    width: 96px;
}

.purchase-lines-table .purchase-col-notes {
    width: 18%;
}

.purchase-lines-table .line-index {
    text-align: center;
    color: var(--muted);
}

.purchase-lines-table .line-name {
    font-weight: 700;
}

.purchase-lines-table .line-spec,
.purchase-lines-table td:last-child {
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.purchase-lines-table tfoot th {
    background: #f6f8f7;
    color: var(--text);
    font-size: 14px;
}

.purchase-side-panel {
    padding: 16px;
}

.purchase-side-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.purchase-side-heading h3 {
    margin: 0;
    font-size: 16px;
}

.purchase-side-heading > span:not(.badge) {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
    text-align: right;
}

.purchase-progress-list {
    list-style: none;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
}

.purchase-progress-list li {
    position: relative;
    min-width: 0;
    padding: 10px 0 10px 30px;
    border-bottom: 1px solid var(--line);
}

.purchase-progress-list li:last-child {
    border-bottom: 0;
}

.purchase-progress-list li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 16px;
    width: 11px;
    height: 11px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.purchase-progress-list li.complete::before {
    border-color: var(--primary);
    background: var(--primary);
}

.purchase-progress-list li.current::before {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(31, 122, 91, 0.12);
}

.purchase-progress-list li.current.danger::before {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(159, 45, 45, 0.12);
}

.purchase-progress-list span {
    display: block;
    font-weight: 700;
    line-height: 1.35;
}

.purchase-progress-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.45;
}

.purchase-progress-list li.pending span {
    color: var(--muted);
    font-weight: 600;
}

.purchase-check-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.purchase-check-list div {
    display: grid;
    grid-template-columns: minmax(88px, 0.9fr) minmax(0, 1.1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.purchase-check-list div.ok {
    border-color: #cde5d7;
    background: #f4fbf7;
}

.purchase-check-list div.warning {
    border-color: #ead8a8;
    background: #fffaf0;
}

.purchase-check-list div.danger {
    border-color: #efc4c4;
    background: #fff6f6;
}

.purchase-check-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.purchase-check-list dd {
    min-width: 0;
    margin: 0;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    text-align: right;
}

.purchase-attachments {
    display: grid;
    gap: 14px;
}

.purchase-attachments .compact-form {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.purchase-approval-panel .section-title {
    margin-bottom: 12px;
}

.purchase-approval-panel .section-title h3 {
    margin: 0;
    font-size: 18px;
}

.purchase-approval-panel .section-title p {
    margin: 4px 0 0;
}

.purchase-approval-panel {
    display: grid;
    gap: 16px;
}

.purchase-print-form {
    max-width: 980px;
    margin: 0 auto;
}

.purchase-print-title {
    text-align: center;
    margin-bottom: 14px;
}

.purchase-print-title h2,
.purchase-print-title h3 {
    margin: 0 0 6px;
}

.purchase-print-meta,
.purchase-print-approvers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 18px;
    margin-bottom: 12px;
}

.purchase-print-approvers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.purchase-print-inline-note {
    color: var(--muted);
    margin-left: 12px;
    font-size: 12px;
}

.purchase-print-attachment {
    break-before: page;
    page-break-before: always;
}

.purchase-print-attachment-caption {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
}

.purchase-print-attachment-img {
    display: block;
    max-width: 100%;
    max-height: 250mm;
    margin: 0 auto;
}

.purchase-form-table th {
    width: 150px;
    background: #f6f8f7;
    vertical-align: top;
}

.purchase-form-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.purchase-print-section-title {
    margin: 18px 0 8px;
    font-size: 16px;
}

.purchase-print-lines th,
.purchase-print-lines td {
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
}

.purchase-print-lines th:first-child,
.purchase-print-lines td:first-child {
    width: 52px;
    text-align: center;
}

.purchase-print-note {
    margin-top: 12px;
    line-height: 1.7;
}

.purchase-print-note p {
    margin: 4px 0;
}

.purchase-print-warning {
    font-weight: 700;
}

.purchase-signature-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    gap: 0;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    break-inside: avoid;
}

.purchase-signature-box {
    min-height: 104px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-rows: auto auto 48px auto;
    text-align: center;
    background: #ffffff;
}

.purchase-signature-box span {
    display: block;
    margin: 0;
    padding: 6px 5px 5px;
    background: #f6f8f7;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
}

.purchase-signature-box small {
    display: block;
    min-height: 24px;
    padding: 4px 5px 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.purchase-signature-stamp {
    min-height: 48px;
}

.purchase-signature-box strong {
    display: block;
    min-height: 22px;
    padding: 4px 5px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    line-height: 1.2;
}

.receipt-note-editor-header {
    margin-top: 22px;
    margin-bottom: 12px;
}

.payment-receipt-notes-preview {
    display: grid;
    gap: 14px;
}

.payment-receipt-notes-preview section {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.payment-receipt-notes-preview section:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.payment-receipt-notes-preview h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.payment-receipt-notes-preview p {
    margin: 0;
    line-height: 1.7;
}

.payment-receipt-paper {
    max-width: 920px;
    margin: 0 auto;
    padding: 34px 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(24, 32, 28, 0.05);
}

.payment-receipt-heading {
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--text);
}

.payment-receipt-heading h1,
.payment-receipt-heading h2,
.payment-receipt-heading p {
    margin: 0;
}

.payment-receipt-heading h2 {
    font-size: 22px;
    letter-spacing: 0;
}

.payment-receipt-heading h1 {
    margin-top: 8px;
    font-size: 26px;
    letter-spacing: 0;
}

.payment-receipt-heading p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.payment-receipt-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 13px;
}

.payment-receipt-section-title {
    margin: 0 0 8px;
    font-size: 16px;
}

.payment-receipt-person-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.payment-receipt-person-grid div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 42px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.payment-receipt-person-grid .span-2 {
    grid-column: span 2;
}

.payment-receipt-person-grid span {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f6f8f7;
    color: var(--muted);
    font-weight: 700;
}

.payment-receipt-person-grid strong {
    min-width: 0;
    padding: 8px 10px;
    font-weight: 600;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.payment-receipt-table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
}

.payment-receipt-table th,
.payment-receipt-table td {
    border: 1px solid var(--line);
    vertical-align: top;
}

.payment-receipt-table th {
    width: 132px;
    background: #f6f8f7;
    text-align: center;
}

.payment-receipt-table td {
    line-height: 1.7;
}

.payment-receipt-category-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.receipt-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.receipt-check::before {
    content: "";
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    border: 1px solid var(--text);
    color: var(--text);
    font-size: 11px;
    line-height: 1;
}

.receipt-check.checked::before {
    content: "✓";
}

.payment-receipt-inline-text {
    margin: 8px 0 0;
}

.payment-receipt-number-money {
    display: block;
    margin-top: 6px;
}

.payment-receipt-attestation {
    min-height: 72px;
    text-align: center;
}

.payment-receipt-signature {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    break-inside: avoid;
}

.payment-receipt-signature > div {
    width: 340px;
    border: 1px solid var(--line);
    text-align: center;
}

.payment-receipt-signature span {
    display: block;
    padding: 7px 8px;
    background: #f6f8f7;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}

.payment-receipt-stamp {
    min-height: 160px;
}

.payment-receipt-print-notes {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.payment-receipt-print-notes p {
    margin: 0;
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    :root {
        --bg: #ffffff;
        --surface: #ffffff;
        --line: #d8d8d8;
        --text: #000000;
        --muted: #555555;
    }

    body {
        background: #ffffff;
        color: #000000;
        font-family: "DFKai-SB", "BiauKai", "標楷體", "KaiTi", "TW-Kai", "Noto Serif TC", "PMingLiU", serif;
        font-size: 13px;
        line-height: 1.6;
        overflow: visible;
    }

    .app-shell {
        display: block !important;
        grid-template-columns: none !important;
        min-height: 0;
    }

    .sidebar,
    .topbar,
    .page-tools,
    .alert,
    .no-print,
    .btn,
    .actions form {
        display: none !important;
    }

    .main {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        overflow: visible;
    }

    .content-area {
        display: block !important;
        max-width: 100% !important;
    }

    /* 內容型 panel 允許跨頁流動:避免高內容(如請假單、報表)整塊被推到下一頁,
       造成第一頁只剩抬頭、大片留白。小型卡片與簽核區仍避免被切開。 */
    .panel,
    .stat-card,
    .feature-card {
        box-shadow: none;
        border-color: #d8d8d8;
        margin-bottom: 12px;
    }

    .stat-card,
    .feature-card {
        break-inside: avoid;
    }

    .panel {
        padding: 12px 14px;
        border: 0;
    }

    /* 表格列不被切開,避免半列跨頁。 */
    tr {
        break-inside: avoid;
    }

    .table-wrap {
        overflow: visible;
    }

    table {
        font-size: 11px;
    }

    th,
    td {
        white-space: normal;
        padding: 6px 6px;
    }

    .meta-table th,
    .meta-table td {
        padding: 5px 8px;
        line-height: 1.5;
    }

    .print-document-header {
        display: block !important;
        margin-bottom: 10px;
    }

    /* 精簡抬頭高度,讓內文有更多空間、減少整份文件被推到第二頁。 */
    .print-document-header h2 {
        font-size: 19px;
    }

    .print-document-header h3 {
        margin-top: 4px;
        font-size: 15px;
    }

    .print-document-header .print-logo {
        max-height: 46px;
        margin-bottom: 4px;
    }

    .print-document-header .print-meta {
        gap: 4px 14px;
        margin-top: 5px;
        font-size: 11.5px;
    }

    .print-only {
        display: block;
    }

    .receipt-batch {
        display: block;
    }

    .receipt-page {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        break-after: page;
        page-break-after: always;
    }

    .receipt-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    /* 收據列印:標楷體、寬鬆間距,充分利用整個 A4 版面(仍維持單頁)。 */
    .receipt-print-shell {
        padding: 0 !important;
        border: 0 !important;
        margin: 0 !important;
    }

    .official-receipt {
        max-width: none;
        margin: 0;
        padding: 12mm 14mm;
        line-height: 1.8;
        break-inside: avoid;
    }

    .official-receipt .rc-head {
        margin-bottom: 10px;
    }

    .official-receipt .rc-org-line {
        gap: 16px;
    }

    .official-receipt .rc-org {
        font-size: 24px;
    }

    .official-receipt .rc-logo {
        height: 44px;
        max-width: 140px;
    }

    .official-receipt .rc-title {
        font-size: 28px;
        letter-spacing: 15px;
        margin: 6px 0 12px;
    }

    .official-receipt .rc-datno {
        font-size: 16px;
        margin-bottom: 14px;
        padding-bottom: 7px;
    }

    .official-receipt .rc-recital {
        font-size: 17px;
        margin: 14px 0 16px;
    }

    .official-receipt .rc-recital-line + .rc-recital-line {
        margin-top: 10px;
    }

    .official-receipt .rc-fill {
        min-width: 200px;
    }

    .official-receipt .rc-fill-donor {
        min-width: 0;
    }

    .official-receipt .rc-fill-sm {
        min-width: 150px;
    }

    .official-receipt .rc-body {
        padding: 13px 18px;
        margin: 14px 0;
    }

    .official-receipt .rc-row {
        font-size: 17px;
        margin: 6px 0;
    }

    .official-receipt .rc-amount-cn {
        font-size: 18px;
    }

    .official-receipt .rc-thanks {
        font-size: 17px;
        margin: 18px 0 22px;
    }

    .official-receipt .rc-stamps {
        margin-top: 12px;
        gap: 28px;
    }

    .official-receipt .rc-stamp-box {
        width: 4cm;
        height: 4cm;
        border-color: #bbbbbb;
    }

    .official-receipt .rc-stamp-label {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .official-receipt .rc-stamp-people {
        font-size: 16px;
        line-height: 2.6;
    }

    .official-receipt .rc-stamp-space {
        min-width: 150px;
    }

    .official-receipt .rc-footer {
        margin-top: 20px;
        padding-top: 10px;
        font-size: 12.5px;
        line-height: 1.85;
    }

    .board-meeting-print {
        max-width: none;
        margin: 0 0 12px;
        padding: 0;
        break-inside: avoid;
    }

    .official-letter {
        max-width: none;
        margin: 0;
        padding: 0;
        break-inside: avoid;
    }

    .official-letter .ol-org-seal {
        color: #cc3344;
    }

    .budget-statement {
        border: 0;
        padding: 0;
    }

    .statement-table {
        min-width: 0;
        width: 100%;
        font-size: 10px;
    }

    .statement-table th,
    .statement-table td {
        padding: 5px 4px;
    }

    .signature-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
        gap: 14px;
        break-inside: avoid;
    }

    .signature-box .signature-stamp {
        height: 64px;
        max-width: 3.2cm;
        border: 1px solid #888888;
        color: #999999;
    }

    .signature-box .signature-role {
        font-size: 14px;
    }

    .signature-box .signature-name {
        font-size: 14px;
        margin-top: 8px;
    }

    .purchase-print-form {
        max-width: none;
        border: 0;
        padding: 0;
    }

    .purchase-print-meta,
    .purchase-print-approvers {
        font-size: 12px;
    }

    .purchase-form-table,
    .purchase-print-lines {
        width: 100%;
        font-size: 11px;
    }

    .purchase-form-table th,
    .purchase-form-table td,
    .purchase-print-lines th,
    .purchase-print-lines td {
        padding: 6px 5px;
    }

    .purchase-signature-grid {
        grid-template-columns: repeat(6, minmax(72px, 1fr));
        margin-top: 12px;
        break-inside: avoid;
    }

    .purchase-signature-box {
        min-height: 88px;
        grid-template-rows: auto auto 40px auto;
    }

    .purchase-signature-box span {
        padding: 5px 4px 4px;
    }

    .purchase-signature-box small {
        min-height: 20px;
        padding: 3px 4px 1px;
        font-size: 10px;
    }

    .purchase-signature-stamp {
        min-height: 40px;
    }

    .purchase-signature-box strong {
        min-height: 18px;
        padding: 3px 4px;
        font-size: 10px;
    }

    .payment-receipt-paper {
        max-width: none;
        margin: 0;
        padding: 16mm 10mm 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .payment-receipt-heading {
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .payment-receipt-heading h2 {
        font-size: 20px;
    }

    .payment-receipt-heading h1 {
        font-size: 24px;
    }

    .payment-receipt-meta-row,
    .payment-receipt-heading p {
        font-size: 11px;
    }

    .payment-receipt-person-grid div {
        min-height: 36px;
    }

    .payment-receipt-person-grid span,
    .payment-receipt-person-grid strong,
    .payment-receipt-table th,
    .payment-receipt-table td {
        padding: 5px 6px;
    }

    .payment-receipt-table {
        margin-top: 12px;
        font-size: 11px;
    }

    .payment-receipt-signature {
        margin-top: 20px;
    }

    .payment-receipt-stamp {
        min-height: 150px;
    }

    .payment-receipt-print-notes {
        margin-top: 12px;
        font-size: 10px;
    }

    /* 費用申請憑證附件:列印時接續於申請單後,另起新頁,依 A4 版面編排。
       單欄呈現,每張憑證完整顯示(不裁切),避免跨頁被切開,約每頁兩張。 */
    .er-attach-section {
        break-before: page;
        page-break-before: always;
    }

    .er-attach-grid {
        display: block !important;
    }

    .er-attach-grid .pcq-attach {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 0;
        margin: 0 0 8mm;
        text-align: center;
    }

    .er-attach-grid .er-attach-caption {
        margin-bottom: 4px;
        font-size: 11px;
        color: #444444;
        text-align: left;
    }

    .er-attach-grid .pcq-attach img {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 120mm;
        object-fit: contain;
    }

    .er-attach-grid .pcq-attach__file {
        display: inline-block;
        height: auto;
        padding: 12px 20px;
        background: transparent;
        border: 1px dashed #999999;
        color: #333333;
    }
}

@media screen and (max-width: 900px) {
    .app-shell {
        display: block;
    }

    /* 行動版頂列:固定於頂端,含漢堡按鈕與基金會名稱。 */
    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 60;
        padding: 10px 14px;
        background: var(--sidebar);
        color: #fff;
    }

    .mobile-bar-title {
        font-size: 16px;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 8px;
        background: transparent;
        cursor: pointer;
    }

    .mobile-nav-toggle-bars,
    .mobile-nav-toggle-bars::before,
    .mobile-nav-toggle-bars::after {
        content: "";
        display: block;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .mobile-nav-toggle-bars {
        position: relative;
    }

    .mobile-nav-toggle-bars::before {
        position: absolute;
        top: -6px;
    }

    .mobile-nav-toggle-bars::after {
        position: absolute;
        top: 6px;
    }

    /* 開啟時漢堡變成關閉叉。 */
    .app-shell.nav-open .mobile-nav-toggle-bars {
        background: transparent;
    }

    .app-shell.nav-open .mobile-nav-toggle-bars::before {
        top: 0;
        transform: rotate(45deg);
    }

    .app-shell.nav-open .mobile-nav-toggle-bars::after {
        top: 0;
        transform: rotate(-45deg);
    }

    /* 側邊選單改為由左側滑出的抽屜,預設收起。 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(84vw, 320px);
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 70;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.28);
    }

    .app-shell.nav-open .sidebar {
        transform: translateX(0);
    }

    .app-shell.nav-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgba(0, 0, 0, 0.45);
    }

    .login-shell {
        grid-template-columns: 1fr;
        padding: 28px 18px;
    }

    .login-card {
        justify-self: stretch;
        width: 100%;
    }

    .purchase-line-grid,
    .purchase-summary-grid,
    .purchase-info-grid,
    .purchase-detail-layout,
    .purchase-print-meta,
    .purchase-print-approvers,
    .purchase-signature-grid,
    .payment-receipt-person-grid {
        grid-template-columns: 1fr;
    }

    .purchase-summary-vendor {
        grid-column: span 1;
    }

    .payment-receipt-paper {
        padding: 22px 18px;
    }

    .payment-receipt-person-grid .span-2 {
        grid-column: span 1;
    }

    .payment-receipt-meta-row {
        justify-content: flex-start;
    }

    .purchase-detail-hero {
        display: grid;
        grid-template-columns: 1fr;
    }

    .purchase-detail-title h2 {
        font-size: 21px;
    }

    .purchase-hero-insight,
    .purchase-detail-actions {
        max-width: none;
    }

    .purchase-detail-hero .actions,
    .purchase-detail-actions {
        justify-content: flex-start;
    }

    .purchase-detail-sidebar {
        position: static;
    }

    .purchase-section-heading {
        display: block;
    }

    .purchase-field-list div,
    .purchase-narrative-list section {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .purchase-summary-tile strong {
        font-size: 22px;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
    }

    .nav {
        gap: 14px;
    }

    .main {
        max-width: none;
        padding: 16px;
    }

    .stats-grid,
    .update-summary,
    .budget-summary,
    .grid-form,
    .module-grid,
    .activity-workbench,
    .two-column-report {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .topbar,
    .panel-header,
    .account {
        align-items: flex-start;
        flex-direction: column;
    }

    .release-box,
    .release-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .budget-line {
        grid-template-columns: 1fr;
    }

    .voucher-line {
        grid-template-columns: 1fr;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .calendar-weekday {
        display: none;
    }

    .calendar-day {
        min-height: auto;
        border-right: 0;
    }

    .recon-form {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .voucher-line-head {
        display: none;
    }

    .voucher-line .btn {
        width: 100%;
    }

    .budget-line .btn {
        width: 100%;
    }

    /* ---- 行動版版型優化(功能不變,僅避免內容超出畫面寬度) ---- */

    /* 簽核／用印欄:窄螢幕改為兩欄,避免整列超出畫面被裁切。 */
    .signature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-top: 22px;
    }
    .signature-box .signature-stamp {
        max-width: none;
        height: 62px;
    }

    /* 面板留白縮小,爭取內容寬度。 */
    .panel {
        padding: 14px 12px;
    }

    /* 文件型表格(明細、資料表)於窄螢幕允許換行,避免固定 nowrap 造成水平溢出。 */
    .panel th,
    .panel td {
        white-space: normal;
        word-break: break-word;
        padding: 8px 8px;
    }
    /* 清單型表格維持不換行,改以容器水平捲動呈現(既有 .table-wrap 行為)。 */
    .table-wrap th,
    .table-wrap td {
        white-space: nowrap;
        word-break: normal;
    }

    /* 查詢／篩選列在窄螢幕換行,欄位可自動伸縮。 */
    .search {
        flex-wrap: wrap;
    }
    .search > * {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* 多欄輸入表格(獎勵人員、費用明細)在窄螢幕改為堆疊卡片:每欄獨立一列並顯示欄位標籤,
       避免欄位被壓到過窄而無法正常輸入。 */
    .entry-table thead {
        display: none;
    }
    .entry-table,
    .entry-table tbody,
    .entry-table tbody tr,
    .entry-table tbody td {
        display: block;
        width: 100%;
    }
    .entry-table tbody tr {
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 12px;
        background: #fff;
    }
    .entry-table tbody td {
        border: 0;
        padding: 6px 0;
    }
    .entry-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 4px;
    }
    .entry-table input,
    .entry-table select,
    .entry-table textarea {
        width: 100%;
        box-sizing: border-box;
    }
    .entry-table .rw-remove,
    .entry-table .er-item-remove {
        width: 100%;
    }
    .entry-table .rw-remove::after,
    .entry-table .er-item-remove::after {
        content: " 刪除此列";
    }
    /* 合計列單行呈現。 */
    .entry-table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 2px solid var(--line);
        padding-top: 8px;
    }
    .entry-table tfoot td {
        display: inline-block;
        width: auto;
        border: 0;
        padding: 0;
        text-align: right;
    }
    .entry-table tfoot td:empty {
        display: none;
    }
}

/* 表單分區:基本資料常駐,其餘以 <details> 收合,減少一次顯示的欄位量。 */
.form-section {
    grid-column: 1 / -1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #fbfbfc;
}
.form-section > h3 {
    margin: 0 0 12px;
    font-size: 15px;
}
.form-section > .grid-form {
    margin: 0;
}
details.form-section > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    list-style: none;
    user-select: none;
}
details.form-section > summary::-webkit-details-marker { display: none; }
details.form-section > summary::before { content: "▸"; color: #8a8a8a; margin-right: 8px; }
details.form-section[open] > summary::before { content: "▾"; }
details.form-section[open] > summary { margin-bottom: 14px; }

/* 零用金手機快速記帳 */
.pcq-form { gap: 16px; }
.pcq-type { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pcq-type__btn { position: relative; }
.pcq-type__btn input { position: absolute; opacity: 0; pointer-events: none; }
.pcq-type__btn span {
    display: block; text-align: center; padding: 14px 0; border: 1px solid var(--line);
    border-radius: 10px; font-size: 17px; font-weight: 600; color: var(--muted); background: #fff; cursor: pointer;
}
.pcq-type__btn input:checked + span { border-color: #1d5fa8; color: #1d5fa8; background: #eef4fb; }
.pcq-amount span, .pcq-label { display: block; color: var(--muted); margin-bottom: 6px; font-size: 14px; }
.pcq-amount input { font-size: 30px; font-weight: 700; text-align: right; min-height: 58px; padding: 8px 14px; }
.pcq-field { display: block; }
.pcq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pcq-chip {
    padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
    font-size: 15px; color: var(--text); cursor: pointer;
}
.pcq-chip.is-active { border-color: #1d5fa8; color: #1d5fa8; background: #eef4fb; }
.pcq-previews { display: flex; flex-wrap: wrap; gap: 10px; }
.pcq-preview { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pcq-preview--file {
    display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px;
    font-size: 12px; color: var(--muted); background: #f5f5f5; word-break: break-all;
}
.pcq-more { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fbfbfc; }
.pcq-more > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.pcq-more[open] > summary { margin-bottom: 12px; }
.pcq-more .pcq-field { margin-bottom: 12px; }
.pcq-more .pcq-field:last-child { margin-bottom: 0; }
.pcq-submit { width: 100%; min-height: 52px; font-size: 18px; }

/* 零用金憑證附件 */
.pcq-attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.pcq-attach { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pcq-attach img { display: block; width: 100%; height: 140px; object-fit: cover; }
.pcq-attach__file { display: flex; align-items: center; justify-content: center; height: 140px; font-weight: 700; color: var(--muted); background: #f5f5f5; }
.pcq-attach figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }

/* 側邊常用連結區(固定展開,不收合) */
.sidebar .nav-section--quick .nav-section-title { cursor: default; }
.sidebar .nav-section--quick .nav-section-title::after { content: none !important; }
.sidebar .nav-section--quick.collapsed a { display: flex !important; }
.nav-quick-edit {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; margin: 0; padding: 0; border-radius: 6px;
    font-size: 15px; line-height: 1; text-decoration: none; color: inherit; opacity: 0.7;
}
.nav-quick-edit:hover { opacity: 1; background: rgba(255,255,255,0.12); }

/* 常用連結設定頁 */
.ql-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ql-option {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
}
.ql-option.is-checked { border-color: #1d5fa8; background: #eef4fb; }
.ql-option input[type="checkbox"] { width: auto; min-height: 0; flex: 0 0 auto; margin: 0; }
.ql-option__icon {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
    background: #eef1f5; color: #445; font-size: 14px; font-weight: 600;
}
.ql-option__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-option__order { flex: 0 0 auto; width: 58px; min-height: 34px; padding: 4px 8px; text-align: center; }

/* 費用申請:付款方式切換 */
.er-pay-toggle { display: flex; gap: 10px; }
.er-pay-opt { position: relative; flex: 0 0 auto; }
.er-pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.er-pay-opt span {
    display: inline-block; padding: 9px 22px; border: 1px solid var(--line); border-radius: 999px;
    background: #fff; color: var(--muted); cursor: pointer; font-size: 15px;
}
.er-pay-opt input:checked + span { border-color: #1d5fa8; color: #1d5fa8; background: #eef4fb; }
