:root {
  --green: #008f6d;
  --green-dark: #006c53;
  --green-soft: #e8f6f1;
  --ink: #18201e;
  --muted: #66736f;
  --bg: #f5f7f6;
  --card: #ffffff;
  --line: #e4e9e7;
  --sidebar: #14211e;
  --shadow: 0 8px 30px rgba(27, 49, 43, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: var(--sidebar);
  color: #fff;
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--green); font-size: 22px; font-weight: 900; }
.brand-name { font-size: 15px; font-weight: 850; letter-spacing: .03em; line-height: 1.3; }
.brand-name span { display: block; color: #92a6a0; font-size: 11px; font-weight: 500; margin-top: 3px; letter-spacing: .05em; }
nav { flex: 1; overflow-y: auto; padding: 18px 0; }
nav { scrollbar-width: thin; scrollbar-color: rgba(139, 218, 196, .34) transparent; }
nav::-webkit-scrollbar { width: 5px; height: 5px; }
nav::-webkit-scrollbar-track { background: transparent; }
nav::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(139, 218, 196, .34); }
.nav-label { margin: 14px 12px 6px; color: #71847f; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
nav a { display: flex; align-items: center; gap: 11px; min-height: 44px; margin: 3px 0; padding: 9px 12px; border-radius: 10px; color: #b7c5c1; font-weight: 650; text-decoration: none; transition: .2s ease; }
nav a:hover, nav a.active { background: rgba(0,143,109,.18); color: #fff; }
.nav-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.07); color: #8bdac4; font-size: 12px; font-weight: 850; }
.sidebar-footer { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 16px 8px 2px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 13px; }
.sidebar-footer div > span { color: #829791; font-size: 11px; }
.avatar { display: grid; place-items: center; border-radius: 50%; background: #d8f2e9; color: var(--green-dark); font-weight: 850; }
.avatar.small { width: 38px; height: 38px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #42d99b; box-shadow: 0 0 0 4px rgba(66,217,155,.12); }

main { width: 100%; max-width: 1560px; min-height: 100vh; padding: 0 4vw 72px; overflow: hidden; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(245,247,246,.94); backdrop-filter: blur(14px); }
.breadcrumb { margin: 0; color: var(--muted); font-size: 12px; }
.today { margin: 2px 0 0; font-size: 14px; font-weight: 750; }
.topbar-actions, .header-actions, .form-actions { display: flex; align-items: center; gap: 10px; }
.header-actions { flex: 0 0 auto; }
.header-actions button { white-space: nowrap; }
.icon-button { position: relative; width: 39px; height: 39px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #75827e; font-size: 9px; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: #eb655d; border: 2px solid #fff; }
.logout-button { display:inline-flex; align-items:center; gap:6px; border:1px solid #dacac5; background:#fff; color:#7a4e45; }
.logout-button:hover { border-color:#c9988e; background:#fff5f2; color:#9c4032; }
.logout-button span { font-size:15px; line-height:1; }

.welcome-panel { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin: 32px 0 0; padding: 34px 38px; border: 1px solid #dbe9e4; border-radius: 20px; background: linear-gradient(120deg, #f2faf7 0%, #fff 62%); box-shadow: var(--shadow); }
.eyebrow, .section-kicker { color: var(--green); font-size: 11px; font-weight: 850; letter-spacing: .12em; }
h1 { max-width: 760px; margin: 8px 0 12px; font-size: clamp(32px, 4.2vw, 52px); line-height: 1.18; letter-spacing: -.035em; }
h2 { margin: 6px 0 4px; font-size: 28px; line-height: 1.3; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 17px; }
p { margin: 0; }
.hero-copy { max-width: 720px; color: var(--muted); font-size: 16px; }
button { min-height: 40px; padding: 9px 16px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: .18s ease; }
button:hover { background: var(--green-dark); transform: translateY(-1px); }
button:disabled { background: #aeb8b5; cursor: not-allowed; transform: none; }
button.secondary { border: 1px solid #bad9cf; background: #fff; color: var(--green-dark); }
button.secondary:hover { background: var(--green-soft); }
button.danger { background: #c9534c; }
.badge, .soft-badge { display: inline-flex; align-items: center; white-space: nowrap; padding: 5px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 800; }

.toast-message { position: sticky; top: 10px; z-index: 10; min-height: 0; margin-top: 14px; padding: 0; border-radius: 10px; font-size: 13px; }
.toast-message:not(:empty) { padding: 10px 14px; border: 1px solid #cde5dd; background: rgba(242,250,247,.96); box-shadow: 0 6px 20px rgba(24,52,44,.08); }
.module-section { min-height: calc(100vh - 190px); margin-top: 34px; animation: page-enter .24s ease both; }
.module-section[hidden], [data-page-companion][hidden], .system-section[hidden] { display: none !important; }
.first-section { margin-top: 34px; }
.owner-view-badge { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 7px 12px; border: 1px solid #b9dfd2; border-radius: 999px; background: #eef9f5; color: var(--green-dark); font-size: 12px; font-weight: 850; }
.owner-view-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #23b989; box-shadow: 0 0 0 4px rgba(35,185,137,.12); }
.data-source-header-tools { display:flex; flex:0 0 auto; align-items:center; gap:8px; }
.data-source-legend { display:inline-flex; align-items:center; gap:7px; padding:7px 11px; border:1px solid #ecd9a5; border-radius:999px; background:#fffaf0; color:#795a12; font-size:11px; font-weight:750; white-space:nowrap; }
.data-source-legend b,.data-source-trigger { display:inline-grid; place-items:center; border-radius:50%; background:#fff4cf; color:#8b6300; font-weight:900; }
.data-source-legend b { width:18px; height:18px; font-size:11px; }
.has-data-source { position:relative; }
.data-source-trigger { position:absolute; z-index:3; top:10px; right:10px; width:23px; min-width:23px; height:23px; min-height:23px; padding:0; border:1px solid #e4c66f; box-shadow:0 2px 8px rgba(92,68,10,.08); font-family:inherit; font-size:12px; line-height:1; cursor:pointer; }
.data-source-trigger:hover,.data-source-trigger:focus-visible { border-color:#a87908; background:#ffe9a5; color:#654800; transform:none; outline:3px solid rgba(212,163,45,.18); }
.data-source-trigger.inline { position:static; display:inline-grid; margin-left:6px; vertical-align:middle; }
.data-source-trigger.detail { width:18px; min-width:18px; height:18px; min-height:18px; margin-left:4px; border-color:#d9c98f; background:#fffae9; font-size:9px; opacity:.76; }
.data-source-trigger.detail:hover,.data-source-trigger.detail:focus-visible { opacity:1; }
.data-source-detail-card { padding-right:28px !important; }
.data-source-detail-card > .data-source-trigger.detail { position:absolute; top:50%; right:6px; margin:0; transform:translateY(-50%); }
.data-source-detail-card > .data-source-trigger.detail:hover,.data-source-detail-card > .data-source-trigger.detail:focus-visible { transform:translateY(-50%); }
.data-source-dialog { width:min(620px,calc(100vw - 28px)); max-height:calc(100vh - 40px); padding:0; border:0; border-radius:20px; background:#fff; color:var(--ink); box-shadow:0 28px 90px rgba(16,34,29,.28); }
.data-source-dialog::backdrop { background:rgba(14,27,23,.55); backdrop-filter:blur(3px); }
.data-source-sheet { padding:0; }
.data-source-sheet header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:24px 26px 18px; border-bottom:1px solid var(--line); background:linear-gradient(135deg,#f2faf7,#fffaf0); }
.data-source-sheet h2 { margin-top:4px; font-size:24px; }
.data-source-close { width:36px; min-width:36px; min-height:36px; padding:0; border:1px solid var(--line); border-radius:50%; background:#fff; color:#65736f; font-size:22px; line-height:1; }
.data-source-current { display:grid; grid-template-columns:1fr auto; align-items:end; gap:2px 14px; margin:20px 26px 12px; padding:16px 18px; border:1px solid #dce9e5; border-radius:14px; background:#f7fbf9; }
.data-source-current span { grid-column:1/-1; color:var(--muted); font-size:11px; }
.data-source-current strong { font-size:25px; letter-spacing:-.02em; }
.data-source-current b { align-self:center; padding:5px 9px; border-radius:999px; font-size:10px; }
.data-source-current b.live { background:#dff4ed; color:#08785d; }
.data-source-current b.demo { background:#fff0d2; color:#8b5e00; }
.data-source-sheet dl { display:grid; gap:0; margin:0 26px 22px; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.data-source-sheet dl > div { display:grid; grid-template-columns:92px minmax(0,1fr); gap:14px; padding:13px 16px; border-bottom:1px solid var(--line); }
.data-source-sheet dl > div:last-child { border-bottom:0; }
.data-source-sheet dt { color:var(--green-dark); font-size:11px; font-weight:850; }
.data-source-sheet dd { margin:0; color:#4f5d59; font-size:12px; line-height:1.7; }
.data-source-sheet footer { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 26px 22px; }
.data-source-sheet footer span { color:var(--muted); font-size:11px; }
@media (max-width:680px) { .data-source-header-tools { align-items:flex-start; flex-direction:column; }.data-source-sheet dl > div { grid-template-columns:1fr; gap:3px; }.data-source-sheet footer { align-items:stretch; flex-direction:column; }.data-source-sheet footer button { width:100%; } }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-head p { max-width: 680px; color: var(--muted); font-size: 14px; }
.update-note { color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.grid article, .table-panel, .insight-panel, .performance-panel, .create-panel { border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 4px 18px rgba(30,55,48,.04); }

.war-room-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(360px,.75fr); gap: 16px; margin-top: 16px; }
.decision-panel, .cash-snapshot { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 18px rgba(30,55,48,.04); }
.decision-panel .panel-heading, .cash-snapshot .panel-heading { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.decision-list { display: grid; }
.decision-list a { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 74px; padding: 12px 20px; border-bottom: 1px solid #edf1ef; color: var(--ink); text-decoration: none; transition: .18s ease; }
.decision-list a:last-child { border-bottom: 0; }
.decision-list a:hover { background: #f8fbfa; }
.decision-list a div { min-width: 0; }
.decision-list strong, .decision-list small { display: block; }
.decision-list strong { font-size: 13px; }
.decision-list small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.decision-list b { color: var(--green-dark); font-size: 11px; white-space: nowrap; }
.decision-level { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: 11px; font-weight: 900; }
.decision-level.urgent { background: #fff0ed; color: #c9534c; }
.decision-level.attention { background: #fff7e5; color: #a86a00; }
.cash-snapshot-chart { position: relative; min-height: 186px; padding: 22px 18px 8px 46px; background: linear-gradient(180deg,#fbfdfc,#fff); }
.cash-snapshot-chart svg { width: 100%; height: 150px; }
.cash-axis { position: absolute; inset: 24px auto 26px 16px; display: flex; flex-direction: column; justify-content: space-between; color: #8a9692; font-size: 9px; }
.cash-snapshot-meta { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.cash-snapshot-meta div { padding: 14px 16px; border-right: 1px solid var(--line); }
.cash-snapshot-meta div:last-child { border-right: 0; }
.cash-snapshot-meta span, .cash-snapshot-meta strong { display: block; }
.cash-snapshot-meta span { color: var(--muted); font-size: 10px; }
.cash-snapshot-meta strong { margin-top: 3px; font-size: 13px; }

.table-panel { overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.table-head p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.table-head > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.record-tools { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 150px auto auto; gap: 10px; align-items: end; padding: 14px 22px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.record-tools label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.record-tools input { width: 100%; min-height: 38px; }
.record-tools button { min-height: 38px; white-space: nowrap; }
.master-entry-workbench { margin-top: 18px; }
.commercial-plan { margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg,#f8fcfa 0,#fff 180px); }
.section-head.compact { margin-bottom: 16px; }
.section-head.compact h2 { font-size: 21px; }
.commercial-summary { margin-bottom: 16px; }
.commercial-summary small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.commercial-grid,.commercial-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.commercial-forms { margin-top: 16px; }
.commercial-forms form { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.commercial-plan table { min-width: 820px; }
.commercial-plan .table-panel { background: #fff; }
@media (max-width: 900px) { .record-tools { grid-template-columns: 1fr 1fr; } .record-tools label:first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .record-tools { grid-template-columns: 1fr; } .record-tools label:first-child { grid-column: auto; } }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid #edf0ef; text-align: left; vertical-align: middle; font-size: 13px; }
.accounting-pane th, .accounting-pane td { white-space: nowrap; }
.accounting-pane td:nth-child(2) { min-width: 180px; white-space: normal; }
th { background: #fafbfb; color: #6e7c78; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
tbody tr:hover { background: #fbfdfc; }
tbody tr:last-child td { border-bottom: 0; }
.table-action { min-height: 32px; padding: 6px 11px; border-radius: 8px; font-size: 11px; }
.table-select { min-width: 145px; min-height: 34px; margin: 0; padding: 5px 8px; font-size: 11px; }
.table-actions { display: flex; align-items: center; gap: 6px; }
.download-link { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 13px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 750; text-decoration: none; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; font-size: 13px; }

.create-panel { margin-bottom: 16px; overflow: hidden; }
.create-panel > summary, .inline-create > summary, .system-section summary { padding: 15px 20px; color: var(--green-dark); font-size: 13px; font-weight: 800; cursor: pointer; list-style: none; }
.create-panel > summary::-webkit-details-marker, .inline-create > summary::-webkit-details-marker, .system-section summary::-webkit-details-marker { display: none; }
.create-panel[open] > summary { border-bottom: 1px solid var(--line); background: #fbfdfc; }
form { padding: 22px; }
.form-heading { margin-bottom: 18px; }
.form-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; align-items: end; }
label { display: block; margin: 0; color: #3e4b47; font-size: 12px; font-weight: 750; }
input, select, textarea { display: block; width: 100%; min-height: 42px; margin-top: 6px; padding: 9px 11px; border: 1px solid #cad3d0; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,143,109,.1); }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.check input { width: auto; min-height: auto; margin: 0; }
form > button, .form-actions { margin-top: 18px; }

footer { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.master-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:18px 0; }
.master-summary-grid article { padding:18px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.master-summary-grid strong,.master-summary-grid span { display:block; }
.master-summary-grid strong { color:var(--green-dark); font-size:22px; }
.master-summary-grid span { margin-top:3px; color:var(--muted); font-size:12px; }
.master-entry-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.master-entry-grid form { border:1px solid var(--line); border-radius:14px; background:#fff; }
.master-entry-grid .form-grid { grid-template-columns:1fr 1fr; }
.master-card-section { margin-top:18px; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:#fff; }
.master-card-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:16px; }
.master-card { padding:16px; border:1px solid #dfe8e5; border-radius:12px; background:#fbfdfc; }
.master-card header { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.master-card p { margin-top:8px; color:var(--muted); font-size:12px; }
.master-card dl { display:grid; grid-template-columns:auto 1fr; gap:4px 9px; margin:12px 0 0; font-size:11px; }
.master-card dt { color:var(--muted); }.master-card dd { margin:0; font-weight:750; }
.source-tag { display:inline-flex; padding:3px 8px; border-radius:999px; background:var(--green-soft); color:var(--green-dark); font-size:10px; font-weight:800; white-space:nowrap; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .master-entry-grid,.master-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .war-room-grid { grid-template-columns: 1fr; }
  .welcome-panel { align-items: flex-start; flex-direction: column; }
  .welcome-panel .header-actions { width: 100%; }
}
@media (max-width: 920px) {
  body { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding-bottom: 12px; }
  .sidebar nav { display: flex; gap: 5px; padding: 12px 0 2px; overflow-x: auto; }
  .nav-label, .sidebar-footer { display: none; }
  nav a { flex: 0 0 auto; }
  main { padding: 0 22px 56px; }
  .commercial-grid,.commercial-forms { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { min-height: 64px; }
  .breadcrumb { display: none; }
  .welcome-panel { display: block; padding: 26px 22px; }
  .welcome-panel .header-actions { align-items: flex-start; flex-direction: column; margin-top: 22px; }
  .grid, .form-grid { grid-template-columns: 1fr; }
  .master-summary-grid,.master-entry-grid,.master-card-grid { grid-template-columns:1fr; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .module-section { min-height: auto; margin-top: 28px; }
  .decision-list a { grid-template-columns: 34px minmax(0,1fr); }
  .decision-list b { display: none; }
  .decision-list small { white-space: normal; }
  .cash-snapshot-meta { grid-template-columns: 1fr; }
  .cash-snapshot-meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .cash-snapshot-meta div:last-child { border-bottom: 0; }
  footer { flex-direction: column; gap: 6px; }
}

/* 客戶進件快速流程 */
.client-intake-section { --intake-blue:#2775d7; --intake-orange:#e98b2a; }
.intake-page-head { align-items:center; }
.intake-case-bar { display:grid; grid-template-columns:minmax(360px,1.35fr) minmax(220px,.65fr) minmax(230px,.7fr); align-items:center; gap:22px; padding:20px 22px; border:1px solid #dce7e3; border-radius:18px; background:#fff; box-shadow:var(--shadow); }
.intake-case-main { display:flex; align-items:center; gap:14px; min-width:0; }
.intake-case-main h3 { margin-top:3px; font-size:18px; }
.intake-case-main p { margin-top:3px; color:var(--muted); font-size:11px; }
.intake-company-mark { flex:0 0 auto; width:56px; height:56px; display:grid; place-items:center; border-radius:17px; background:linear-gradient(145deg,var(--green),#12af84); color:#fff; font-size:25px; font-weight:900; box-shadow:0 8px 20px rgba(0,143,109,.2); }
.intake-case-progress > div:first-child { display:flex; justify-content:space-between; align-items:baseline; }
.intake-case-progress span { color:var(--muted); font-size:11px; font-weight:750; }
.intake-case-progress strong { color:var(--green-dark); font-size:22px; }
.intake-progress-track { height:8px; margin:5px 0 6px; overflow:hidden; border-radius:999px; background:#e5ece9; }
.intake-progress-track span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--green),#38c79d); }
.intake-case-progress small { color:var(--muted); font-size:10px; }
.intake-switcher { font-size:10px; }
.intake-switcher select { margin-top:4px; }
.intake-focus-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(290px,.65fr); gap:16px; margin-top:16px; }
.intake-next-action { display:grid; grid-template-columns:72px minmax(0,1fr) auto; align-items:center; gap:18px; padding:22px; border:1px solid #b8dfd2; border-radius:18px; background:linear-gradient(125deg,#effaf6 0,#fff 70%); box-shadow:0 6px 22px rgba(0,108,83,.08); }
.intake-next-icon { width:68px; height:68px; display:grid; place-items:center; border-radius:20px; background:var(--green); color:#fff; font-size:22px; font-weight:900; box-shadow:0 9px 24px rgba(0,143,109,.22); }
.intake-next-copy h3 { margin:3px 0 4px; font-size:20px; }
.intake-next-copy > p { max-width:720px; color:var(--muted); font-size:12px; }
.intake-checks { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.intake-checks span { padding:4px 9px; border-radius:999px; background:#fff4e7; color:#9a5c15; font-size:10px; font-weight:800; }
.intake-checks span.done { background:#dff4ed; color:#08785d; }
.intake-next-cta { display:grid; justify-items:end; gap:10px; }
.intake-next-cta small { color:var(--muted); font-size:10px; text-align:right; }
.intake-primary-link,.intake-step a { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:9px 15px; border-radius:9px; background:var(--green); color:#fff; font-size:12px; font-weight:850; text-decoration:none; }
.intake-primary-link:hover,.intake-step a:hover { background:var(--green-dark); }
.intake-alert-card { padding:22px; border:1px solid #f0dcc2; border-radius:18px; background:#fffaf3; }
.intake-alert-card h3 { margin:4px 0 10px; }
.intake-alert-card ul { display:grid; gap:7px; margin:0; padding-left:18px; color:#6d5d48; font-size:11px; }
.intake-flow-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin:30px 0 14px; }
.intake-flow-heading p { margin-top:4px; color:var(--muted); font-size:12px; }
.intake-legend { display:flex; gap:7px; }
.intake-legend span { padding:4px 9px; border-radius:999px; font-size:10px; font-weight:850; }
.intake-legend .complete { background:#dff4ed; color:#08785d; }
.intake-legend .current { background:#e7f0ff; color:#185cae; }
.intake-legend .waiting { background:#edf0ef; color:#68746f; }
.intake-step-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.intake-step { position:relative; min-height:264px; display:flex; flex-direction:column; align-items:flex-start; padding:18px; border:1px solid var(--line); border-radius:17px; background:#fff; box-shadow:0 4px 15px rgba(24,50,43,.04); }
.intake-step.complete { border-color:#cae8de; }
.intake-step.current { border:2px solid var(--intake-blue); background:linear-gradient(150deg,#f3f7ff,#fff 65%); box-shadow:0 10px 28px rgba(39,117,215,.12); }
.intake-step.waiting { background:#f7f8f8; color:#7a8581; }
.intake-step-top { width:100%; display:flex; justify-content:space-between; align-items:center; }
.intake-step-number { color:#9aa5a1; font-size:11px; font-weight:900; letter-spacing:.08em; }
.intake-step-status { padding:3px 8px; border-radius:999px; background:#edf0ef; color:#6c7874; font-size:9px; font-weight:850; }
.intake-step.complete .intake-step-status { background:#dff4ed; color:#08785d; }
.intake-step.current .intake-step-status { background:#dceaff; color:#185cae; }
.intake-big-icon { width:62px; height:62px; display:grid; place-items:center; margin:15px 0 11px; border-radius:18px; background:#e6f6f0; color:var(--green-dark); font-size:24px; font-weight:900; }
.intake-step.current .intake-big-icon { background:var(--intake-blue); color:#fff; box-shadow:0 7px 18px rgba(39,117,215,.22); }
.intake-step.waiting .intake-big-icon { background:#e8ebea; color:#7d8784; }
.intake-step h3 { font-size:16px; }
.intake-step p { min-height:40px; margin:4px 0 10px; color:var(--muted); font-size:11px; }
.intake-step small { margin-bottom:13px; color:#7d8985; font-size:10px; }
.intake-step a,.intake-step button { width:100%; margin-top:auto; }
.intake-step.complete a { border:1px solid #b9dfd2; background:#fff; color:var(--green-dark); }
.intake-step button:disabled { background:#dde2e0; color:#89938f; }
.intake-bottom-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:18px; }
.intake-sop-card,.intake-exception-card { padding:22px; border:1px solid var(--line); border-radius:17px; background:#fff; }
.intake-sop-card h3,.intake-exception-card h3 { margin:4px 0 14px; }
.intake-sop-card > div { display:grid; grid-template-columns:34px 1fr; gap:11px; align-items:center; padding:10px 0; border-top:1px solid #edf1ef; }
.intake-sop-card b { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:var(--green-soft); color:var(--green-dark); }
.intake-sop-card strong,.intake-sop-card small { display:block; }
.intake-sop-card strong { font-size:12px; }.intake-sop-card small { color:var(--muted); font-size:10px; }
.intake-exception-card ul { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.intake-exception-card li { display:flex; justify-content:space-between; gap:14px; padding:11px 13px; border-radius:10px; background:#fff7ed; }
.intake-exception-card strong { color:#9f5b11; font-size:11px; }.intake-exception-card span { color:#776b5e; font-size:10px; text-align:right; }
@media (max-width:1180px) { .intake-case-bar { grid-template-columns:1fr 1fr; }.intake-switcher { grid-column:1/-1; }.intake-step-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:860px) { .intake-focus-grid,.intake-bottom-grid { grid-template-columns:1fr; }.intake-next-action { grid-template-columns:64px 1fr; }.intake-next-cta { grid-column:1/-1; justify-items:stretch; }.intake-next-cta small { text-align:left; } }
@media (max-width:620px) { .intake-case-bar,.intake-step-grid { grid-template-columns:1fr; }.intake-switcher { grid-column:auto; }.intake-flow-heading { align-items:flex-start; flex-direction:column; }.intake-next-action { grid-template-columns:1fr; }.intake-next-icon { width:58px; height:58px; }.intake-step { min-height:240px; } }

/* 角色化收合導覽 */
.role-nav-group { margin:5px 0; }
.role-nav-group > summary { position:relative; display:flex; align-items:center; justify-content:space-between; min-height:36px; padding:7px 10px; border-radius:9px; color:#849892; font-size:10px; font-weight:850; letter-spacing:.08em; cursor:pointer; list-style:none; }
.role-nav-group > summary::-webkit-details-marker { display:none; }
.role-nav-group > summary::after { content:"＋"; color:#69827a; font-size:14px; }
.role-nav-group[open] > summary::after { content:"−"; }
.role-nav-group > summary:hover { background:rgba(255,255,255,.04); color:#c8d4d0; }
.role-nav-items { display:grid; gap:2px; padding:2px 0 7px; }
.role-nav-items a { margin:0; }
.sidebar-role-note { margin:10px 10px 4px; padding:8px 10px; border:1px solid rgba(139,218,196,.14); border-radius:9px; background:rgba(0,143,109,.08); color:#8bdac4; font-size:9px; line-height:1.5; }
@media (max-width:920px) { .role-nav-group { display:contents; }.role-nav-group > summary { display:none; }.role-nav-items { display:flex; gap:5px; padding:0; }.sidebar-role-note { display:none; } }

/* PM 專屬指揮台 */
.pm-page-head { align-items:center; }
.pm-welcome-card { display:grid; grid-template-columns:minmax(260px,.7fr) minmax(500px,1.3fr); align-items:center; gap:24px; padding:22px 24px; border:1px solid #dbe7e3; border-radius:18px; background:linear-gradient(120deg,#f0faf6,#fff 70%); box-shadow:var(--shadow); }
.pm-person { display:flex; align-items:center; gap:14px; }
.pm-person > span { width:62px; height:62px; display:grid; place-items:center; border-radius:19px; background:var(--green); color:#fff; font-size:25px; font-weight:900; box-shadow:0 8px 20px rgba(0,143,109,.2); }
.pm-person small,.pm-person p { color:var(--muted); font-size:10px; }.pm-person h3 { margin:2px 0; font-size:20px; }
.pm-kpis { display:grid; grid-template-columns:repeat(4,1fr); border:1px solid #dce7e3; border-radius:14px; overflow:hidden; background:#fff; }
.pm-kpis div { padding:14px 16px; border-right:1px solid #e6ebe9; }.pm-kpis div:last-child { border-right:0; }
.pm-kpis span,.pm-kpis strong { display:block; }.pm-kpis span { color:var(--muted); font-size:9px; }.pm-kpis strong { margin-top:2px; color:var(--green-dark); font-size:22px; }.pm-kpis .risk strong { color:#c85b45; }
.pm-action-strip { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:14px; }
.pm-action-strip a { display:grid; grid-template-columns:50px 1fr; align-items:center; gap:11px; min-height:74px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:#fff; color:var(--ink); text-decoration:none; box-shadow:0 3px 12px rgba(30,55,48,.04); }
.pm-action-strip a:hover { border-color:#9dd4c3; transform:translateY(-1px); }.pm-action-strip a > span { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; background:var(--green-soft); color:var(--green-dark); font-size:18px; font-weight:900; }
.pm-action-strip strong,.pm-action-strip small { display:block; }.pm-action-strip strong { font-size:12px; }.pm-action-strip small { margin-top:2px; color:var(--muted); font-size:9px; }
.pm-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(310px,.55fr); gap:16px; margin-top:16px; }
.delegation-center,.delegated-projects-card{margin-top:18px;padding:24px;background:#fff;border:1px solid var(--border);box-shadow:0 12px 34px rgba(45,34,29,.06)}
.delegation-center .panel-heading p,.delegation-hint{margin:6px 0 0;color:var(--muted);font-size:.9rem}
.delegation-layout{display:grid;grid-template-columns:minmax(360px,.8fr) minmax(0,1.2fr);gap:22px;margin-top:20px}
.delegation-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;padding:18px;background:#f7f2ed;border-top:5px solid var(--green)}
.delegation-form label{display:grid;gap:7px;font-size:.82rem;font-weight:800;color:#514944}
.delegation-form select,.delegation-form input,.delegation-form textarea{width:100%;box-sizing:border-box;border:1px solid #d6cbc2;background:#fff;padding:11px 12px;color:var(--ink);font:inherit}
.delegation-form textarea{resize:vertical}.delegation-form .delegation-reason,.delegation-form button{grid-column:1/-1}.delegation-form button{min-height:45px}
.delegation-rule{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.delegation-rule strong{width:100%;font-size:.82rem}.delegation-rule span{padding:6px 9px;background:#e8f5f1;color:#087a68;font-size:.76rem;font-weight:800}
.delegation-list{display:grid;gap:10px}.delegation-item{display:grid;grid-template-columns:1fr auto;gap:10px;padding:14px;border:1px solid var(--border);background:#fff}.delegation-item h4{margin:0 0 4px}.delegation-item p{margin:0;color:var(--muted);font-size:.82rem;line-height:1.55}.delegation-item .delegation-meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}.delegation-item button{align-self:center}
.delegated-projects-card{margin-top:16px}.delegated-project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}.delegated-project{padding:16px;border:1px solid var(--border);border-left:5px solid var(--green);color:inherit;text-decoration:none}.delegated-project strong,.delegated-project small{display:block}.delegated-project small{margin-top:5px;color:var(--muted);line-height:1.55}.delegated-project:hover{background:#f4fbf8}
.pm-projects-panel,.pm-focus-card,.pm-risk-card { overflow:hidden; border:1px solid var(--line); border-radius:17px; background:#fff; box-shadow:0 4px 16px rgba(30,55,48,.04); }
.pm-view-tabs { display:flex; gap:5px; }.pm-view-tabs button { min-height:32px; padding:5px 10px; border:1px solid var(--line); background:#fff; color:var(--muted); font-size:10px; }.pm-view-tabs button.active { border-color:#add9cc; background:var(--green-soft); color:var(--green-dark); }
.pm-project-list { display:grid; gap:0; }.pm-project-card { padding:18px 21px; border-top:1px solid #edf1ef; }.pm-project-card.pm-priority { background:linear-gradient(90deg,#fffaf3,#fff 38%); }
.pm-project-title { display:grid; grid-template-columns:44px minmax(0,1fr) auto; align-items:center; gap:11px; }.pm-project-title small { color:#87938f; font-size:9px; }.pm-project-title h3 { margin-top:1px; font-size:14px; }
.pm-client-logo { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; background:#dff4ed; color:#08785d; font-size:17px; font-weight:900; }.pm-client-logo.blue { background:#e3efff; color:#1b64b9; }.pm-client-logo.amber { background:#fff0d8; color:#a66612; }
.pm-project-meta { display:grid; grid-template-columns:1.1fr 1.1fr .55fr; gap:12px; margin:14px 0 10px; }.pm-project-meta span,.pm-project-meta strong { display:block; }.pm-project-meta span { color:var(--muted); font-size:9px; }.pm-project-meta strong { margin-top:2px; color:#34423e; font-size:10px; }
.pm-progress-label { display:flex; justify-content:space-between; color:var(--muted); font-size:9px; }.pm-progress-label strong { color:var(--green-dark); }.pm-progress { height:7px; margin-top:5px; overflow:hidden; border-radius:999px; background:#e7ecea; }.pm-progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--green),#3fc79f); }.pm-progress.blue span { background:linear-gradient(90deg,#2876d7,#6aa9f5); }
.pm-project-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:11px; }.pm-project-footer span { color:var(--muted); font-size:9px; }.pm-project-footer a { color:var(--green-dark); font-size:10px; font-weight:850; text-decoration:none; }
.pm-focus-column { display:grid; align-content:start; gap:16px; }.pm-focus-card .panel-heading { border-bottom:1px solid var(--line); }.pm-focus-card ol { margin:0; padding:8px 18px 16px; list-style:none; }.pm-focus-card li { position:relative; display:grid; grid-template-columns:48px 1fr; gap:10px; padding:12px 0 12px 15px; border-left:2px solid #dfe6e3; }.pm-focus-card li::before { content:""; position:absolute; left:-6px; top:17px; width:9px; height:9px; border:2px solid #fff; border-radius:50%; background:#b8c2be; box-shadow:0 0 0 1px #b8c2be; }.pm-focus-card li.done::before { background:var(--green); box-shadow:0 0 0 1px var(--green); }.pm-focus-card li.current::before { background:#ef932d; box-shadow:0 0 0 4px #fff2df; }.pm-focus-card li b { color:#82908b; font-size:10px; }.pm-focus-card strong,.pm-focus-card small { display:block; }.pm-focus-card strong { font-size:11px; }.pm-focus-card small { margin-top:2px; color:var(--muted); font-size:9px; }
.pm-risk-card { padding:20px; }.pm-risk-card h3 { margin:3px 0 11px; }.pm-risk-card > a { display:grid; grid-template-columns:36px 1fr; gap:10px; align-items:center; padding:11px 0; border-top:1px solid #edf1ef; color:var(--ink); text-decoration:none; }.pm-risk-card > a > span { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:#fff0ed; color:#bd5143; font-size:12px; font-weight:900; }.pm-risk-card strong,.pm-risk-card small { display:block; }.pm-risk-card strong { font-size:11px; }.pm-risk-card small { margin-top:2px; color:var(--muted); font-size:9px; }
@media (max-width:1120px) { .pm-welcome-card,.pm-layout,.delegation-layout { grid-template-columns:1fr; }.pm-action-strip { grid-template-columns:repeat(2,1fr); }.delegated-project-grid{grid-template-columns:1fr 1fr} }
@media (max-width:680px){.delegation-form,.delegated-project-grid{grid-template-columns:1fr}.delegation-form .delegation-reason,.delegation-form button{grid-column:auto}.delegation-center,.delegated-projects-card{padding:18px}}
@media (max-width:680px) { .pm-kpis { grid-template-columns:repeat(2,1fr); }.pm-kpis div:nth-child(2) { border-right:0; }.pm-kpis div:nth-child(-n+2) { border-bottom:1px solid #e6ebe9; }.pm-action-strip { grid-template-columns:1fr; }.pm-project-meta { grid-template-columns:1fr 1fr; }.pm-project-meta span:last-child { grid-column:1/-1; }.pm-project-footer { align-items:flex-start; flex-direction:column; } }

/* 可追蹤營運作業單：取代舊版僅顯示 Toast 的空殼按鈕 */
.operational-evidence{margin:22px 0 4px;border:1px solid #d7e5e0;border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(31,57,49,.05)}
.operational-evidence>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 20px;cursor:pointer;list-style:none;background:linear-gradient(105deg,#eef9f5,#fff);border-radius:16px}
.operational-evidence>summary::-webkit-details-marker{display:none}.operational-evidence>summary span,.operational-evidence>summary b,.operational-evidence>summary small{display:block}.operational-evidence>summary b{color:#184d3e;font-size:13px}.operational-evidence>summary small{margin-top:3px;color:var(--muted);font-size:10px}.operational-evidence>summary>strong{padding:5px 10px;border-radius:999px;background:#dff3ec;color:#08785d;font-size:10px}
.operational-evidence-list{display:grid;gap:10px;padding:16px 20px 20px;border-top:1px solid #e5eeeb}.operational-empty{margin:0;padding:16px;border:1px dashed #cadad4;background:#f8fbfa;color:#72817c;font-size:11px}.operational-empty.error{border-color:#efc8c1;background:#fff6f4;color:#aa4d3e}
.operational-record{display:grid;grid-template-columns:118px minmax(0,1fr) auto;gap:15px;align-items:center;padding:14px;border:1px solid #e0e8e5;background:#fff}.operational-record-code span,.operational-record-code strong{display:block}.operational-record-code span{color:#7a8984;font-size:9px}.operational-record-code strong{margin-top:2px;color:#176f58;font-size:11px}.operational-record-body>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.operational-record-body>div>strong{font-size:12px}.operational-record-body p{margin:4px 0;color:#52615c;font-size:10px;line-height:1.5}.operational-record-body small{display:block;color:#89948f;font-size:9px}.operational-record-body small+small{margin-top:4px;color:#a25b20}.operational-status{padding:3px 7px;border-radius:999px;background:#edf1ef;color:#65726e;font-size:8px;font-weight:850}.operational-status.pending_review{background:#fff0d8;color:#9a5b13}.operational-status.approved{background:#e4efff;color:#225da5}.operational-status.completed{background:#dff4ed;color:#08785d}.operational-status.cancelled{background:#f4e8e5;color:#a44a3d}.operational-record-actions{display:flex;gap:7px}.operational-record-actions button{min-height:32px;padding:6px 10px;font-size:9px}
@media(max-width:720px){.operational-record{grid-template-columns:1fr}.operational-record-actions{justify-content:flex-start}.operational-evidence>summary{align-items:flex-start}}

/* Authorized document originals and readable version history. */
#documents .document-body{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;background:#f5f4f0;padding:16px;max-height:600px;overflow:auto}#documents code{overflow-wrap:anywhere}#documents .document-content-form textarea,#documents input[type=file]{width:100%;min-width:0}#documents .document-content-form>label:has(textarea),#documents .document-content-form>p{grid-column:1/-1}#documents details{margin:12px 0}#documents summary{cursor:pointer;font-weight:700}#documents [data-document-list]{display:grid;gap:16px;margin-top:18px}#documents .integration-record{min-width:0;overflow-wrap:anywhere}

#documents [data-document-drafts]{width:18px;height:18px;min-height:18px;margin:0 8px 0 0}#documents label:has([data-document-drafts]){display:flex;align-items:center;flex-direction:row}

@media(max-width:700px){#notifications [data-notification-list]>article{display:flex;flex-direction:column;align-items:stretch;gap:12px}#notifications [data-notification-list]>article>div{width:100%;min-width:0;flex:auto}#notifications [data-notification-list] article p,#notifications [data-notification-list] article strong,#notifications [data-notification-list] article small{display:block;width:auto;overflow-wrap:anywhere}#notifications [data-notification-list]>article>button,#notifications [data-notification-list]>article>a{align-self:flex-start}}

#notifications [data-notification-list]>article{grid-template-columns:minmax(0,1fr) auto auto}#notifications [data-notification-list]>article>div{min-width:0}#notifications [data-notification-list] strong{font-size:15px}#notifications [data-notification-list] p,#notifications [data-notification-list] small{font-size:13px;line-height:1.6}#notifications [data-notification-list] p{margin:8px 0}

#project-change-plan-center{padding:20px;min-width:0;overflow-wrap:anywhere}
#project-change-plan-center fieldset{min-width:0;margin:14px 0;padding:16px;border:1px solid var(--line,#d5dfd9)}
#project-change-plan-center input,#project-change-plan-center select{max-width:100%;min-width:0}
#project-change-plan-center legend{font-weight:700;padding:0 6px}
#project-change-plan-center .wide{grid-column:1/-1;min-width:0}

.contact-list-filter { display: grid; gap: 8px; padding: 0 20px 16px; max-width: 100%; box-sizing: border-box; }
.contact-list-filter select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
#einvoice-reference-group[hidden] { display: none !important; }
