:root{
  --brand-purple:#311075;
  --brand-purple-dark:#26125c;
  --brand-purple-light:#4a2a8f;
  --brand-purple-soft:#f3eefb;
  --brand-champagne:#f0d9a8;
  --brand-champagne-soft:rgba(240,217,168,.92);
  --brand-ink-soft:#f7f4ff;
  --sidebar-w:260px;
  --sidebar-brand-h:140px;
  --sidebar-user-h:85px;
  --topbar-h:64px;
  --page-bg:#f0f2f7;
  --card-shadow:0 4px 20px rgba(49,16,117,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:Arial,"Microsoft JhengHei",sans-serif;background:var(--page-bg);color:#243044}
body:has(.app-chrome){
  --sidebar-w:260px;
  --topbar-h:64px;
  background:#fff;
}
body:has(.app-chrome) main{
  position:relative;z-index:1;
  margin-left:var(--sidebar-w);
  padding:calc(var(--topbar-h) + 24px) 28px 28px;
  min-height:100vh;
  background-color:#fff;
  background-image:url('/images/marble-texture.png');
  background-repeat:no-repeat;
  background-size:cover;
  background-position:center top;
  background-attachment:fixed;
}
.app-sidebar{
  position:fixed;left:0;top:0;bottom:0;width:var(--sidebar-w);
  background:var(--brand-purple);
  color:#fff;display:flex;flex-direction:column;z-index:40;
  box-shadow:4px 0 24px rgba(38,18,92,.22);overflow:hidden;
}
.app-sidebar::before{
  content:'';position:absolute;left:-8%;right:-8%;top:var(--sidebar-brand-h);bottom:calc(var(--sidebar-user-h) + 10px);
  background:url('/images/sidebar-building.png?v=20260729bld') center bottom/contain no-repeat;
  opacity:1;pointer-events:none;z-index:0;
  filter:brightness(1.22) contrast(1.28);
}
.app-sidebar::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(49,16,117,.02) 0%,rgba(38,18,92,.05) 60%,rgba(38,18,92,.16) 100%);
  pointer-events:none;z-index:0;
}
.app-sidebar>*{position:relative;z-index:1}
.sidebar-brand{
  position:relative;isolation:isolate;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  height:var(--sidebar-brand-h);min-height:var(--sidebar-brand-h);
  padding:0;box-sizing:border-box;
  border-bottom:0;
  /* 原圖天際線 + 中央不透明遮罩（避免圖內字樣造成殘影） */
  background-color:#2a0e5c;
  background-image:
    radial-gradient(ellipse 62% 46% at 50% 48%,#2a0e5c 0%,#2a0e5c 58%,rgba(42,14,92,.0) 72%),
    url('/images/sidebar-brand-hero.png?v=20260814hero1');
  background-repeat:no-repeat,no-repeat;
  background-position:center center,center center;
  background-size:cover,cover;
}
.sidebar-brand::before,
.sidebar-brand::after{content:none;display:none}
.sidebar-brand-link{
  position:relative;z-index:1;
  display:flex;align-items:center;justify-content:center;
  width:100%;max-width:100%;height:100%;text-decoration:none;color:inherit;
}
/* 字級維持；顏色對齊原品牌圖（英文白、中文香檳金＋兩側細線） */
.sidebar-brand-stack{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:7px;text-align:center;padding:0 12px;width:100%;
}
.sidebar-brand-en{
  display:block;font-family:'Montserrat',Arial,sans-serif;font-size:34px;font-weight:700;
  letter-spacing:.16em;line-height:1;color:#fff;
  text-indent:.16em;
}
.sidebar-brand-zh{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  font-family:'Noto Sans TC','Microsoft JhengHei',sans-serif;font-size:14px;font-weight:600;
  letter-spacing:.42em;line-height:1;color:var(--brand-champagne);
  text-indent:.42em;
}
.sidebar-brand-zh::before,
.sidebar-brand-zh::after{
  content:'';display:block;width:26px;height:1px;background:var(--brand-champagne);flex-shrink:0;
  text-indent:0;opacity:.9;
}
.sidebar-brand-main,.sidebar-brand-edition{display:none}
.sidebar-brand-logo{
  display:block;width:auto;max-width:180px;height:auto;
  max-height:58px;object-fit:contain;object-position:left center;
}
.sidebar-logo{
  width:42px;height:42px;border-radius:50%;background:#fff;color:var(--brand-purple);
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;flex-shrink:0;
}
.sidebar-brand-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.sidebar-title{font-size:17px;font-weight:700;letter-spacing:.03em;color:#fff;line-height:1.2}
.sidebar-subtitle{font-size:12px;color:rgba(255,255,255,.72);line-height:1.2}
.sidebar-nav{flex:1;overflow:auto;padding:14px 12px 16px}
.app-sidebar .sidebar-link,.app-sidebar .sidebar-toggle{
  width:100%;display:flex;align-items:center;gap:12px;padding:12px 14px;margin-bottom:4px;
  border:0;border-radius:10px;background:transparent;color:#fff;
  text-decoration:none;font:inherit;font-size:14px;cursor:pointer;text-align:left;
  -webkit-appearance:none;appearance:none;
}
.app-sidebar .sidebar-link:hover,.app-sidebar .sidebar-toggle:hover{background:rgba(255,255,255,.1);color:#fff}
.app-sidebar .sidebar-link.active,.app-sidebar .sidebar-toggle.active{background:rgba(255,255,255,.16);color:#fff;font-weight:600}
.app-sidebar .sidebar-icon{width:18px;height:18px;flex-shrink:0;color:#fff;stroke:#fff}
.app-sidebar .sidebar-chevron{width:14px;height:14px;margin-left:auto;color:#fff;opacity:.75;transition:transform .2s}
.app-sidebar .sidebar-group.open .sidebar-chevron{transform:rotate(90deg)}
.app-sidebar .sidebar-submenu{display:none;padding:2px 0 8px 44px}
.app-sidebar .sidebar-group.open .sidebar-submenu{display:block}
.app-sidebar .sidebar-submenu a{
  display:block;padding:9px 12px;border-radius:8px;color:rgba(255,255,255,.82);
  text-decoration:none;font-size:13px;margin-bottom:2px;
}
.app-sidebar .sidebar-submenu a:hover{background:rgba(255,255,255,.1);color:#fff}
.app-sidebar .sidebar-submenu a.active{background:rgba(255,255,255,.18);color:#fff;font-weight:600}
.sidebar-submenu-group{margin-bottom:4px}
.sidebar-submenu-label{
  display:block;padding:6px 12px 3px;
  font-size:11px;font-weight:700;letter-spacing:.05em;
  color:rgba(255,255,255,.5);text-transform:uppercase;
}
.sidebar-submenu-group a{padding:7px 12px 7px 20px !important}

/* 案件管理／專案流程：折疊式子選單（簡潔線條） */
.case-accordion{padding:2px 0 8px 44px !important}
.case-fold{margin:0 0 2px}
.case-fold-toggle{
  position:relative;width:100%;display:flex;align-items:center;justify-content:flex-start;
  padding:9px 28px 9px 0;border-radius:0;cursor:pointer;font:inherit;font-size:13px;font-weight:600;
  color:rgba(255,255,255,.92);text-align:left;background:transparent;
  border:0;border-bottom:1px solid rgba(255,255,255,.22);
  box-shadow:none;
}
.case-fold-toggle > span{flex:0 1 auto;text-align:left}
.case-fold-toggle:hover{
  color:#fff;background:rgba(255,255,255,.06);
  border-bottom-color:rgba(255,255,255,.35);
}
.case-fold.is-open .case-fold-toggle{
  color:#fff;border-bottom-color:rgba(255,255,255,.4);
}
/* 與功能管理同列層級的單項連結（下緣線、左對齊） */
.app-sidebar .sidebar-submenu a.case-fold-link,
.app-sidebar .case-accordion > a.case-fold-link{
  position:relative;display:block;width:100%;box-sizing:border-box;
  padding:9px 28px 9px 0 !important;margin:0 0 2px;border-radius:0;
  font-size:13px;font-weight:600;line-height:1.3;
  color:rgba(255,255,255,.92);text-align:left;text-decoration:none;
  background:transparent;
  border:0;border-bottom:1px solid rgba(255,255,255,.22);
  box-shadow:none;
}
.app-sidebar .sidebar-submenu a.case-fold-link:hover,
.app-sidebar .case-accordion > a.case-fold-link:hover{
  color:#fff;background:rgba(255,255,255,.06);
  border-bottom-color:rgba(255,255,255,.35);
}
.app-sidebar .sidebar-submenu a.case-fold-link.active,
.app-sidebar .case-accordion > a.case-fold-link.active{
  color:#fff;font-weight:600;background:transparent;
  border-bottom-color:rgba(255,255,255,.4);
}
.case-fold-chevron{
  position:absolute;right:0;top:50%;transform:translateY(-50%);
  width:14px;height:14px;flex-shrink:0;opacity:.7;transition:transform .18s;
  stroke:rgba(255,255,255,.85);
}
.case-fold.is-open .case-fold-chevron{transform:translateY(-50%) rotate(180deg);opacity:.95}
.case-fold-panel{padding:4px 0 8px 0}
.case-fold-panel[hidden]{display:none !important}
.case-fold-panel a{
  display:block;padding:8px 10px;margin-bottom:1px;border-radius:6px;
  color:rgba(255,255,255,.82);text-decoration:none;font-size:13px;font-weight:400;
}
.case-fold-panel a:hover{background:rgba(255,255,255,.1);color:#fff}
.case-fold-panel a.active{background:rgba(255,255,255,.16);color:#fff;font-weight:600}
.sidebar-user{
  position:relative;padding:12px 14px 16px;min-height:var(--sidebar-user-h);
  border-top:1px solid rgba(255,255,255,.1);background:rgba(0,0,0,.08);
}
.sidebar-user-btn{
  width:100%;display:flex;align-items:center;gap:12px;padding:8px;
  border:0;border-radius:12px;background:transparent;color:#fff;cursor:pointer;text-align:left;font:inherit;
}
.sidebar-user-btn:hover{background:rgba(255,255,255,.08)}
.sidebar-user-avatar{
  width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.18);
  display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0;color:#fff;
  overflow:hidden;background-size:cover;background-position:center;
}
.sidebar-user-avatar.has-image{font-size:0;background-color:rgba(255,255,255,.18)}
.sidebar-user-info{min-width:0;flex:1}
.sidebar-user-info strong{display:block;font-size:14px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user-info span{display:block;font-size:12px;color:rgba(255,255,255,.78);margin-top:2px}
.sidebar-user-info small{display:block;font-size:11px;color:rgba(255,255,255,.55);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user-caret{width:16px;height:16px;flex-shrink:0;opacity:.7;transition:transform .2s}
.sidebar-user-btn[aria-expanded="true"] .sidebar-user-caret{transform:rotate(180deg)}
.sidebar-user-dropdown{
  display:none;position:absolute;left:14px;right:14px;bottom:calc(100% - 8px);
  background:#fff;border:1px solid #e8eaf0;border-radius:12px;box-shadow:0 12px 32px rgba(15,23,42,.18);
  overflow:hidden;z-index:60;
}
.sidebar-user-dropdown.show{display:block}
.sidebar-user-dropdown-head{padding:12px 14px;border-bottom:1px solid #f1f5f9}
.sidebar-user-dropdown-head strong{display:block;font-size:14px;color:#1e293b}
.sidebar-user-dropdown-head small{display:block;font-size:12px;color:#64748b;margin-top:4px}
.sidebar-user-dropdown a{display:block;padding:12px 14px;color:#334155;text-decoration:none;font-size:14px}
.sidebar-user-dropdown a:hover{background:#f8fafc}
.sidebar-user-dropdown a.logout-link{color:#b91c1c;border-top:1px solid #f1f5f9}
.sidebar-user-dropdown a.logout-link:hover{background:#fef2f2}
.sidebar-user-feature-list{border-top:1px solid #f1f5f9;padding:6px 0}
.sidebar-user-feature-title{
  padding:8px 14px 4px;font-size:11px;font-weight:600;letter-spacing:.04em;
  color:#94a3b8;text-transform:none;
}
.sidebar-user-feature-toggle,.sidebar-user-feature-link,.sidebar-user-feature-panel button{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 14px;border:0;background:transparent;color:#334155;font:inherit;font-size:14px;
  text-align:left;cursor:pointer;text-decoration:none;height:auto;min-width:0;border-radius:0;letter-spacing:normal;
}
.sidebar-user-feature-toggle:hover,.sidebar-user-feature-link:hover,.sidebar-user-feature-panel button:hover{
  background:#f8fafc;
}
.sidebar-user-feature-toggle svg{width:14px;height:14px;opacity:.55;transition:transform .18s;flex-shrink:0}
.sidebar-user-feature-toggle[aria-expanded="true"] svg{transform:rotate(90deg)}
.sidebar-user-feature-panel{display:none;padding:0 0 4px}
.sidebar-user-feature-panel.show{display:block}
.sidebar-user-feature-panel button{padding-left:26px;color:#475569}
.sidebar-user-feature-panel button.is-active{
  color:var(--brand-purple);font-weight:600;background:rgba(49,16,117,.06);
}

/* 頂欄 */

/* 卡片／區塊／白底容器 */

/* 區塊標題／欄位標籤 */

/* 表單 */

/* 表格 */

/* 一般按鈕（非 primary） */

/* 側欄使用者選單 */

/* 待辦／日曆／流程細節 */
.app-topbar{
  position:fixed;left:var(--sidebar-w);right:0;top:0;height:var(--topbar-h);
  background:rgba(255,255,255,.92);backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(232,234,240,.9);display:flex;align-items:center;
  justify-content:space-between;padding:0 20px;gap:16px;z-index:30;
}
.topbar-left{display:flex;align-items:center;gap:12px;min-width:0}
.topbar-menu-btn{
  display:none;width:38px;height:38px;border:0;border-radius:10px;background:#f4f5f8;
  color:#475569;cursor:pointer;align-items:center;justify-content:center;padding:0;
}
.topbar-menu-btn svg{width:20px;height:20px}
.topbar-breadcrumb{display:flex;align-items:center;gap:8px;font-size:14px;color:#64748b;white-space:nowrap}
.topbar-breadcrumb a{color:#64748b;text-decoration:none}
.topbar-breadcrumb a:hover{color:var(--brand-purple)}
.topbar-breadcrumb .current{color:#1e293b;font-weight:600}
.topbar-breadcrumb .sep{opacity:.45}
.topbar-right{display:flex;align-items:center;justify-content:flex-end;margin-left:auto;min-width:0;gap:10px}
.topbar-notify{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:8px;color:var(--brand-purple-dark,#311075);
  text-decoration:none;flex:0 0 auto;
}
.topbar-notify.has-unread{color:#b91c1c}
.topbar-notify:hover{background:rgba(49,16,117,.08);color:var(--brand-purple,#4c1d95)}
.topbar-notify-badge{
  position:absolute;top:2px;right:2px;min-width:16px;height:16px;padding:0 4px;
  border-radius:999px;background:#dc2626;color:#fff;font-size:10px;font-weight:700;
  line-height:16px;text-align:center;box-sizing:border-box;
}
.topbar-org-name{
  font-size:15px;font-weight:700;color:var(--brand-purple-dark);
  letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:min(360px,42vw);text-align:right;
}
.portal-action-modal{max-width:440px}
.portal-action-btns{display:flex;flex-direction:column;gap:10px}
.portal-action-btns .primary{width:100%}
.portal-invite-result{margin-top:16px;padding-top:14px;border-top:1px solid #e8eaf0}
.portal-invite-result label{display:block;font-size:13px;color:#475569}
.portal-invite-result input{margin-top:6px}
.topbar-brand-logo{display:flex;align-items:center;line-height:0;text-decoration:none}
.topbar-brand-logo img{height:52px;width:auto;max-width:260px;object-fit:contain;object-position:center;display:block}
.sidebar-overlay{display:none}
main{padding:28px 36px}
.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:12px;flex-wrap:wrap}
.toolbar h2{margin:0}
.toolbar input,.toolbar select{width:240px}
.search-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.search-bar input{width:160px}
.card{background:rgba(255,255,255,.94);border-radius:14px;box-shadow:var(--card-shadow);padding:18px;overflow:auto;margin-bottom:18px;border:1px solid rgba(238,240,245,.95)}
table{width:100%;border-collapse:collapse}
th,td{padding:12px;border-bottom:1px solid #e6edf5;text-align:left;font-size:14px}
th{background:var(--brand-purple-soft);color:var(--brand-purple-dark);overflow-wrap:break-word;word-break:keep-all;line-break:strict}
input,select,textarea{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:6px;background:#fff}
textarea{min-height:76px;resize:vertical}
.case-goods-textarea{min-height:180px;resize:vertical}
table thead th.sortable{cursor:pointer;user-select:none;white-space:nowrap}
table thead th.sortable:hover{color:var(--brand-purple,#311075)}
table thead th .sort-ind{font-size:11px;color:#64748b}
button{border:0;border-radius:8px;padding:10px 15px;cursor:pointer;background:#e2e8f0;color:#243044;font-family:inherit}
/* Unified action buttons: fixed height + padding + nowrap, so equal text length => equal size.
   Kept at element-level specificity so component rules (tabs, chips, sidebar…) still win. */
button:where(:not([class]),.primary,.small,.danger,.close,.btn,.btn-primary,.btn-outline,.btn-ghost,.btn-danger,.data-exchange-toggle,.case-cancel-btn,.contract-archive-btn,.doc-btn),
a:where(.primary,.small,.danger,.btn,.doc-btn){
  --btn-bg:#fff;--btn-fg:var(--brand-purple);--btn-bd:#d5cde8;--btn-bg-h:var(--brand-purple-soft);--btn-bd-h:#b3a5d6;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;
  height:36px;min-width:64px;padding:0 16px;
  border:1px solid var(--btn-bd);border-radius:8px;background:var(--btn-bg);color:var(--btn-fg);
  font-family:inherit;font-size:14px;font-weight:600;line-height:1;letter-spacing:.02em;
  white-space:nowrap;text-decoration:none;vertical-align:middle;cursor:pointer;
  transition:background-color .15s,border-color .15s,color .15s,box-shadow .15s;
}
button:where(:not([class]),.primary,.small,.danger,.close,.btn,.btn-primary,.btn-outline,.btn-ghost,.btn-danger,.data-exchange-toggle,.case-cancel-btn,.contract-archive-btn,.doc-btn):where(:hover:not(:disabled)),
a:where(.primary,.small,.danger,.btn,.doc-btn):where(:hover){background:var(--btn-bg-h);border-color:var(--btn-bd-h)}
button:where(:not([class]),.primary,.small,.danger,.close,.btn,.btn-primary,.btn-outline,.btn-ghost,.btn-danger,.data-exchange-toggle,.case-cancel-btn,.contract-archive-btn,.doc-btn):where(:focus-visible),
a:where(.primary,.small,.danger,.btn,.doc-btn):where(:focus-visible){outline:2px solid rgba(74,42,143,.45);outline-offset:2px}
button:where(.primary,.btn-primary,.doc-btn-complete),a:where(.primary,.btn-primary,.doc-btn-complete){
  --btn-bg:var(--brand-purple);--btn-fg:#fff;--btn-bd:var(--brand-purple);
  --btn-bg-h:var(--brand-purple-light);--btn-bd-h:var(--brand-purple-light);
  box-shadow:0 1px 2px rgba(49,16,117,.22);
}
button:where(.danger,.btn-danger,.doc-btn-void),a:where(.danger,.btn-danger,.doc-btn-void){
  --btn-bg:#fff;--btn-fg:#b42318;--btn-bd:#f0c2c2;--btn-bg-h:#fef2f2;--btn-bd-h:#e8a0a0;
}
button:where(.small,.contract-archive-btn,.doc-btn),a:where(.small,.doc-btn){height:30px;min-width:52px;padding:0 12px;font-size:13px;border-radius:7px}
button:where(.close){width:36px;min-width:36px;padding:0;font-size:18px;font-weight:400;--btn-fg:#64748b;--btn-bd:transparent;--btn-bg:transparent;--btn-bg-h:#f1f5f9;--btn-bd-h:transparent}
.actions button:where(.close){width:auto;min-width:64px;padding:0 16px;font-size:14px;font-weight:600;--btn-fg:var(--brand-purple);--btn-bd:#d5cde8;--btn-bg:#fff;--btn-bg-h:var(--brand-purple-soft);--btn-bd-h:#b3a5d6}
button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.data-exchange-menu button{height:auto;min-width:0;font-weight:500;letter-spacing:0}
.small{margin-right:4px}
.danger:not(button):not(a){background:#fee2e2;color:#b91c1c}
.modal{display:none;position:fixed;inset:0;background:#0008;z-index:5000;padding:calc(var(--topbar-h,64px) + 20px) 28px 28px;overflow:auto}
.modal.is-open{display:block}
.modal-box{max-width:960px;margin:0 auto;background:#fff;border-radius:10px;padding:22px;box-shadow:0 20px 50px rgba(15,23,42,.2)}
button.primary:disabled,button.small:disabled{opacity:.45;cursor:not-allowed}
.modal-title{display:flex;justify-content:space-between;align-items:center}
.modal-title h3{margin:0 0 18px}
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.grid label,.form-grid label{font-size:13px;color:#475569;display:block}
.grid input,.grid select,.grid textarea,.form-grid input,.form-grid select,.form-grid textarea{margin-top:5px}
.wide{grid-column:1/-1}
.actions{text-align:right;margin-top:20px}
.actions button{margin-left:8px}
#pager{padding-top:15px;text-align:center}
.section{background:#fff;border-radius:10px;box-shadow:0 3px 14px #00000014;margin-bottom:18px;overflow:hidden}
.section-title{background:#dbeafe;color:#1e3a5f;padding:12px 18px;font-weight:700;font-size:15px;border-bottom:1px solid #bfdbfe;display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px}
.section-title-with-action{display:flex;align-items:center;justify-content:space-between;gap:12px}
.section-title-with-action .small{font-weight:600}
.case-same-as-customer{display:inline-flex;align-items:center;gap:6px;font-weight:500;font-size:13px;color:#334155;cursor:pointer;margin-left:auto}
.case-same-as-customer input{margin:0;width:auto}
.section-body{padding:18px}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.form-grid.cols-3{grid-template-columns:repeat(3,1fr)}
.case-party-list{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.case-party-card{border:1px solid #e2e8f0;border-radius:10px;background:rgba(255,255,255,.78);padding:12px 14px}
.case-party-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.case-party-head strong{font-size:14px;color:#334155}
.field-label,.kv-label{overflow-wrap:break-word;word-break:keep-all;line-break:strict}
.field-label{background:#eff6ff;border:1px solid #dbeafe;border-radius:6px 6px 0 0;padding:6px 10px;font-size:12px;color:#1e3a5f;margin-bottom:0}
.field-label+input,.field-label+select,.field-label+textarea,.field-label+.status-checks{border-radius:0 0 6px 6px;margin-top:0}
.field-label+.status-checks{
  border:1px solid #cbd5e1;border-top:0;background:#fff;padding:10px 12px;box-sizing:border-box;
}
.required .field-label{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.page-actions{display:flex;gap:8px;justify-content:flex-end;margin-bottom:18px;flex-wrap:wrap}
.case-new-actions{align-items:flex-start}
.case-action-item{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:72px}
.case-action-hint{font-size:11px;line-height:1.35;color:#64748b;text-align:center;max-width:7.5em}
.tm-image-box{width:160px;height:160px;border:1px dashed #94a3b8;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#f8fafc;color:#64748b;font-size:13px;overflow:hidden}
.tm-image-box img{max-width:100%;max-height:100%}
.amount-box{max-width:720px}
.amount-inline{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.amount-inline>input[type="number"],.amount-inline>input[type="text"],.amount-inline>input:not([type]){flex:1;min-width:140px}
.amount-inline .rate-label{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:13px;color:#475569}
.amount-inline .rate-label input{width:110px}
.amount-receipt{margin-top:14px;border-style:dashed}
.kv-form{border:1px solid #dbeafe;border-radius:8px;overflow:hidden}
.kv-row{display:grid;grid-template-columns:160px 1fr;border-bottom:1px solid #e2e8f0}
.kv-row:last-child{border-bottom:0}
.kv-label{background:#dbeafe;color:#1e3a5f;padding:12px 14px;font-size:13px;display:flex;align-items:center}
.kv-row.required .kv-label{background:#fecaca;color:#7f1d1d}
.kv-field{padding:10px 12px;background:#fff}
.kv-field input,.kv-field select,.kv-field textarea{width:100%}
.status-checks{display:flex;gap:24px;align-items:center;min-height:42px}
.status-checks label{display:flex;align-items:center;gap:6px;font-size:14px;color:#243044;cursor:pointer}
.status-checks input{width:auto;margin:0}
.home-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(260px,0.55fr);gap:18px;align-items:stretch}
.bulletin-card{margin-bottom:18px}
.todo-card{margin-bottom:18px}
.home-todo-card{
  margin-bottom:0;display:flex;flex-direction:column;min-height:0;min-width:0;
  height:100%;max-height:none;
}
.home-todo-card .todo-header{flex-direction:column;align-items:stretch;gap:10px;margin-bottom:12px}
.home-todo-card .todo-header-actions{justify-content:space-between;width:100%}
.home-todo-card .todo-tabs{width:100%}
.home-todo-card .todo-tab{flex:1;text-align:center;padding:8px 10px;font-size:13px}
.home-todo-card .todo-list{
  flex:1;min-height:420px;max-height:calc(100vh - 280px);overflow:auto;margin:0;padding:0;list-style:none;
}
.home-todo-card .todo-list li{padding:10px 8px;border-bottom:1px solid #f1f5f9;font-size:13px}
.qq-actions{vertical-align:middle;text-align:center;width:72px}
.qq-action-stack{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}
.qq-action-stack .small{margin-right:0}
.qq-download-link{display:inline-block;text-align:center;line-height:1.2;padding:0;border:0;background:transparent;color:#2563eb;text-decoration:none;font-size:13px}
.qq-download-link:hover{text-decoration:underline}
.date-stack{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;line-height:1.25;font-variant-numeric:tabular-nums;gap:1px}
.date-stack .date-year{font-size:13px;font-weight:600;color:#334155}
.date-stack .date-md{font-size:12px;color:#64748b}
.todo-header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.todo-header-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.todo-manage-link{font-size:13px;color:var(--brand-purple);text-decoration:none;white-space:nowrap;padding:6px 10px;border:1px solid #c4b5fd;border-radius:6px;background:#f5f3ff}
.todo-manage-link:hover{background:#ede9fe}
.todo-card-preview .todo-header{margin-bottom:10px}
.todo-tabs{display:flex;gap:8px;flex-wrap:wrap}
.todo-tab{border:1px solid #cbd5e1;background:#f8fafc;color:#475569;border-radius:8px;padding:8px 14px;cursor:pointer;font-size:14px;text-decoration:none;display:inline-block}
.todo-tab.active{background:var(--brand-purple);border-color:var(--brand-purple);color:#fff}
.workflow-step-nav{display:flex;flex-direction:column;gap:12px}
.workflow-step-nav-row{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}
.workflow-step-nav-row.is-hidden{display:none !important}
.workflow-step-nav-row:empty{display:none}
.workflow-step-nav .todo-tab{
  width:auto;min-height:38px;box-sizing:border-box;text-align:center;
  padding:8px 14px;font-size:14px;border-radius:8px;line-height:1.3;
  margin:0 12px 0 0;display:inline-flex;align-items:center;justify-content:center;
}
.workflow-step-nav .todo-tab:last-child{margin-right:0}
.workflow-step-meta-row{
  display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;
}
.workflow-step-meta-row .workflow-step-nav-row{
  flex:1 1 auto;min-width:0;margin:0;
}
.workflow-step-meta-row .workflow-step-nav-row:empty{display:none}
.workflow-step-sortbar{
  display:flex;align-items:flex-end;justify-content:flex-end;gap:12px;
  margin:0;flex:0 0 auto;
}
.workflow-step-sortbar select{
  width:160px;height:38px;box-sizing:border-box;margin:0;
}
.todo-page-main{display:flex;flex-direction:column;min-height:calc(100vh - var(--topbar-h) - 48px)}
.todo-workspace{display:flex;gap:0;flex:1;min-height:560px;background:#f7f5f2 url('/images/marble-texture.png') center top/cover no-repeat;border-radius:14px;box-shadow:var(--card-shadow);border:1px solid rgba(238,240,245,.95);overflow:hidden}
.todo-main-pane{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;padding:18px 18px 0;background:transparent}
.todo-list-scroll{flex:1 1 auto;min-height:0;overflow:auto;padding-bottom:12px;position:relative;z-index:1}
.todo-group{margin-bottom:18px}
.todo-group-title{margin:0 0 10px;padding:0 2px;font-size:15px;font-weight:700;color:#1e293b}
#todoImportantGroup .todo-group-title{color:#b45309}
.todo-task-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.todo-section-empty{list-style:none;padding:10px 12px;font-size:13px;background:rgba(255,255,255,.55);border:1px dashed #cbd5e1;border-radius:10px}
.todo-task-row{display:flex;align-items:center;gap:12px;padding:12px 14px;background:rgba(255,255,255,.78);border:1px solid #e8eaf0;border-radius:10px;cursor:pointer;transition:border-color .15s,box-shadow .15s,background .15s}
.todo-task-row:hover{border-color:#c4b5fd;box-shadow:0 2px 10px rgba(91,33,182,.08);background:rgba(255,255,255,.92)}
.todo-task-row.selected{border-color:var(--brand-purple);background:rgba(250,245,255,.9)}
.todo-task-row.completed .todo-title{text-decoration:line-through;color:#94a3b8}
.todo-task-main{flex:1;min-width:0}
.todo-complete-circle{width:22px;height:22px;border-radius:50%;border:2px solid #94a3b8;background:transparent;padding:0;flex-shrink:0;cursor:pointer}
.todo-complete-circle.checked{border-color:var(--brand-purple);background:var(--brand-purple);box-shadow:inset 0 0 0 3px #fff}
.todo-comment-btn{border:0;background:transparent;color:#64748b;display:inline-flex;align-items:center;justify-content:center;padding:2px;cursor:pointer;border-radius:6px}
.todo-comment-btn:hover{color:var(--brand-purple);background:#f5f3ff}
.todo-comment-pane{width:380px;background:#f7f5f2 url('/images/marble-texture.png') center/cover no-repeat}
.todo-comment-pane .todo-detail-head,
.todo-comment-pane .todo-detail-body{background:transparent}
.todo-comment-head-title{flex:1;min-width:0}
.todo-comment-head-title .muted{font-size:11px}
.todo-comment-head-title strong{display:block;font-size:14px;color:#1e293b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.todo-comment-thread{display:flex;flex-direction:column;gap:10px;margin-bottom:14px;max-height:34vh;overflow:auto;font-size:12px}
.todo-comment-thread .muted{font-size:12px}
.todo-comment-item{padding:8px 10px;border:1px solid #e2e8f0;border-radius:10px;background:rgba(255,255,255,.75)}
.todo-comment-item.mine{border-color:#c4b5fd;background:rgba(245,243,255,.9)}
.todo-comment-item.theirs{border-color:#cbd5e1;background:rgba(255,255,255,.88)}
.todo-task-row.unread{box-shadow:inset 3px 0 0 var(--brand-purple)}
.todo-comment-item-meta{font-size:11px;color:#64748b;margin-bottom:4px}
.todo-comment-item-body{font-size:12px;color:#1e293b;white-space:pre-wrap}
.todo-comment-editor{border:1px solid #d6d3d1;border-radius:10px;background:#f7f5f2 url('/images/marble-texture.png') center/cover no-repeat;padding:8px;color:#1e293b}
.todo-comment-editor textarea{width:100%;box-sizing:border-box;border:1px solid #e2e8f0;background:rgba(255,255,255,.72);color:#1e293b;border-radius:8px;padding:8px 10px;resize:vertical;min-height:96px;font-size:12px;line-height:1.45;font-family:inherit}
.todo-comment-editor textarea:focus{outline:none;border-color:#c4b5fd;background:rgba(255,255,255,.9)}
.todo-comment-editor textarea::placeholder{color:#94a3b8;font-size:12px}
.todo-comment-toolbar{display:flex;align-items:center;gap:8px;margin-top:8px}
.todo-comment-tool{border:0;background:rgba(255,255,255,.55);color:#475569;font-size:15px;line-height:1;cursor:pointer;padding:4px 6px;border-radius:6px}
.todo-comment-tool:hover{background:rgba(255,255,255,.9);color:var(--brand-purple)}
.todo-comment-toolbar .primary{margin-left:auto}
.todo-comment-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.todo-chip{display:inline-flex;align-items:center;gap:4px;background:rgba(255,255,255,.8);border:1px solid #d6d3d1;color:#334155;border-radius:999px;padding:2px 8px;font-size:11px}
.todo-chip button{border:0;background:transparent;color:#64748b;cursor:pointer;font-size:13px;line-height:1;padding:0;height:auto;min-width:0}
.todo-chip button:hover{color:#1e293b}
.todo-attach-row{margin-top:6px;display:flex;flex-wrap:wrap;gap:8px}
.todo-attach-link{font-size:12px;color:var(--brand-purple)}
.todo-star-btn{border:0;background:transparent;color:#cbd5e1;font-size:20px;line-height:1;cursor:pointer;padding:0 2px}
.todo-star-btn.active,.todo-star-btn:hover{color:#d97706}
.todo-myday-btn{border:0;background:transparent;color:#cbd5e1;font-size:18px;line-height:1;cursor:pointer;padding:0 2px}
.todo-myday-btn.active,.todo-myday-btn:hover{color:#ea580c}
.todo-steps-block .todo-detail-row.static{border:0;border-radius:0;background:transparent;margin:0;padding:12px 12px 6px}
.todo-steps-list{list-style:none;margin:0;padding:0 8px}
.todo-step-row{display:flex;align-items:center;gap:8px;padding:8px 4px;border-top:1px solid #eef2f7}
.todo-step-row.completed .todo-step-title{text-decoration:line-through;color:#94a3b8}
.todo-step-title{flex:1;min-width:0;font-size:13px;color:#334155;word-break:break-word}
.todo-step-title-input{flex:1;min-width:0;border:0;background:transparent;font-size:13px;color:#334155;padding:4px 0}
.todo-step-title-input:focus{outline:none;border-bottom:1px solid #c4b5fd}
.todo-step-row.completed .todo-step-title-input{text-decoration:line-through;color:#94a3b8}
.todo-step-del{border:0;background:transparent;color:#94a3b8;cursor:pointer;font-size:16px;line-height:1;padding:0 4px}
.todo-step-del:hover{color:#b91c1c}
.todo-step-add-row{display:flex;align-items:center;gap:8px;padding:8px 12px 12px}
.todo-step-add-circle{font-size:16px;font-weight:600;color:#64748b;display:inline-flex;align-items:center;justify-content:center}
.todo-step-input{flex:1;min-width:0;border:0;background:transparent;font-size:13px;color:#1e293b;padding:6px 0}
.todo-step-input:focus{outline:none}
.todo-step-input::placeholder{color:#94a3b8}
.todo-notes-block{padding:0;overflow:hidden}
.todo-detail-notes{display:block;width:100%;box-sizing:border-box;min-height:120px;resize:vertical;border:0;background:transparent;padding:14px 16px;font:inherit;font-size:14px;line-height:1.5;color:#334155}
.todo-detail-notes:focus{outline:none}
.todo-detail-notes::placeholder{color:#94a3b8}
.todo-add-bar{display:flex;align-items:center;gap:10px;margin:0 -18px 0;padding:14px 18px;border-top:1px solid #e8eaf0;background:#f7f5f2 url('/images/marble-texture.png') center/cover no-repeat;color:#334155;flex-shrink:0;position:relative;z-index:3}
.todo-add-plus{border:0;background:transparent;font-size:24px;line-height:1;color:#475569;cursor:pointer;padding:4px 6px;border-radius:8px;flex-shrink:0}
.todo-add-plus:hover{color:var(--brand-purple);background:rgba(255,255,255,.55)}
.todo-add-bar input{flex:1;min-width:0;border:0;background:transparent;color:#1e293b;font-size:15px;padding:8px 0}
.todo-add-bar input::placeholder{color:#94a3b8}
.todo-add-bar input:focus{outline:none}
.todo-add-bar input.todo-add-input-hint::placeholder{color:#b91c1c}
.todo-detail-pane{width:340px;flex-shrink:0;border-left:1px solid #e8eaf0;background:#f7f5f2 url('/images/marble-texture.png') center/cover no-repeat;display:flex;flex-direction:column;position:relative;z-index:4}
.todo-detail-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid #e8eaf0;background:rgba(255,255,255,.45)}
.todo-detail-head-spacer{flex:1;min-width:0}
.todo-detail-title{flex:1;min-width:0;width:100%;border:0;background:transparent;font-size:16px;font-weight:600;color:#1e293b;padding:4px 0;cursor:text}
.todo-detail-title:focus{outline:none;border-bottom:1px solid #c4b5fd}
.todo-detail-name-field{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:rgba(255,255,255,.92);font-size:12px;color:#64748b;font-weight:600}
.todo-detail-name-input{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-size:15px;font-weight:600;color:#1e293b;padding:10px 12px;cursor:text}
.todo-detail-name-input:focus{outline:none;border-color:#8b5cf6;box-shadow:0 0 0 3px rgba(139,92,246,.15)}
.todo-detail-close{border:0;background:transparent;font-size:22px;color:#64748b;cursor:pointer;line-height:1}
.todo-detail-body{flex:1;overflow:auto;padding:12px;background:transparent}
.todo-detail-row{width:100%;display:flex;align-items:center;gap:10px;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:rgba(255,255,255,.78);margin-bottom:10px;cursor:pointer;text-align:left;font:inherit;color:#334155}
.todo-detail-row.static{cursor:default;margin-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}
.todo-detail-row.active{border-color:#c4b5fd;background:#f5f3ff;color:var(--brand-purple)}
.todo-detail-icon{width:20px;text-align:center;opacity:.8}
.todo-detail-block{margin-bottom:10px;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden;background:rgba(255,255,255,.78)}
.todo-detail-fields{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;padding:10px 12px 12px;align-items:end}
.todo-detail-fields label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#64748b}
.todo-detail-fields input,.todo-detail-fields select{padding:8px;border:1px solid #cbd5e1;border-radius:6px;font-size:13px}
.todo-repeat-fields{grid-template-columns:1fr}
.todo-weekday-picks{display:flex;flex-wrap:wrap;gap:8px}
.todo-weekday-picks label{flex-direction:row;align-items:center;gap:4px;font-size:13px;color:#475569}
.todo-detail-foot{display:flex;justify-content:space-between;gap:8px;padding:12px 16px;border-top:1px solid #e8eaf0;background:rgba(255,255,255,.45)}
.todo-message-form{margin:0 0 14px;grid-template-columns:1.6fr auto auto;position:relative}
.todo-mention-wrap{position:relative;min-width:0}
.todo-mention-wrap input{width:100%;box-sizing:border-box}
.todo-mention-hint{margin-top:6px;font-size:12px}
.todo-mention-list{position:fixed;z-index:5000;margin:0;padding:4px 0;list-style:none;background:#fff;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 10px 28px rgba(15,23,42,.2);max-height:280px;overflow-y:auto;box-sizing:border-box;font-size:13px}
.todo-mention-list li{padding:6px 10px;cursor:pointer;display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:13px;line-height:1.3;color:#334155}
.todo-mention-list li strong{font-size:13px;font-weight:600}
.todo-mention-list li .muted{font-size:12px;color:#94a3b8}
.todo-mention-list li:hover{background:#f5f3ff}
.todo-mention-list li.muted{cursor:default;color:#94a3b8}
.todo-mention-list li.muted:hover{background:transparent}
.industry-trends-toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.industry-trends-meta{margin:4px 0 0;font-size:13px}
.industry-filter-row{display:flex;align-items:flex-start;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.industry-filter-label{min-width:40px;padding-top:10px;font-size:13px;color:#64748b;font-weight:600}
.industry-trends-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:0}
.industry-tab{border:1px solid #cbd5e1;background:#f8fafc;color:#475569;border-radius:8px;padding:8px 14px;cursor:pointer;font-size:14px}
.industry-tab.active{background:var(--brand-purple);border-color:var(--brand-purple);color:#fff}
.industry-news-list{list-style:none;margin:0;padding:0;margin-top:8px}
.industry-news-item{padding:14px 0;border-bottom:1px solid #eef2f7}
.industry-news-item:last-child{border-bottom:none}
.industry-news-title{font-size:16px;font-weight:600;color:#1e293b;text-decoration:none}
.industry-news-title:hover{color:var(--brand-purple);text-decoration:underline}
.industry-news-meta{display:flex;gap:12px;flex-wrap:wrap;margin-top:6px;font-size:12px;color:#64748b}
.industry-news-summary{margin:8px 0 0;font-size:13px;color:#475569;line-height:1.6}
.industry-news-empty{padding:12px 0}
.todo-sort{font-size:13px;color:#475569;display:flex;align-items:center;gap:6px}
.todo-sort select{padding:6px 10px;border:1px solid #cbd5e1;border-radius:6px}
.todo-show-completed{font-size:13px;color:#475569;display:flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer}
.todo-show-completed input{margin:0}
.todo-form{display:grid;grid-template-columns:1.4fr auto auto auto auto;gap:10px;align-items:end;margin-bottom:14px;padding:12px;background:#f8fafc;border-radius:10px;border:1px solid #e2e8f0}
.todo-form label{font-size:13px;color:#475569;display:flex;flex-direction:column;gap:4px}
.todo-form input,.todo-form select{padding:8px 10px;border:1px solid #cbd5e1;border-radius:6px;font-size:14px}
.todo-form .inline-check{flex-direction:row;align-items:center;white-space:nowrap;padding-bottom:8px}
.todo-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.todo-item{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;flex-wrap:wrap}
.todo-item.completed .todo-title{text-decoration:line-through;color:#94a3b8}
.todo-item.unread{border-color:#c4b5fd;background:#faf5ff}
.todo-body{flex:1;min-width:180px}
.todo-title{font-size:14px;color:#1e293b;font-weight:600;word-break:break-word}
.todo-meta{font-size:12px;color:#64748b;margin-top:4px;display:flex;gap:8px;flex-wrap:wrap}
.todo-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.todo-badge{font-size:12px;color:#2563eb;background:#eff6ff;padding:4px 8px;border-radius:999px;white-space:nowrap}
.todo-empty{padding:12px 0}
.bulletin-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.bulletin-header h3{margin:0;color:#1e3a5f}
.bulletin-list{display:flex;flex-direction:column;gap:12px}
.bulletin-item{border:1px solid #e2e8f0;border-radius:10px;padding:14px 16px;background:#f8fafc}
.bulletin-item.pinned{border-color:#bfdbfe;background:#eff6ff}
.bulletin-item.archived{opacity:.72;background:#f1f5f9;border-color:#cbd5e1}
.bulletin-item.archived h4{color:#64748b}
.bulletin-item-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.bulletin-item h4{margin:0 0 6px;color:#153e75;font-size:16px}
.bulletin-meta{font-size:12px;color:#64748b}
.bulletin-pin{display:inline-block;background:#2563eb;color:#fff;font-size:11px;padding:2px 8px;border-radius:999px;margin-right:8px;vertical-align:middle}
.bulletin-content{margin-top:10px;font-size:14px;line-height:1.6;color:#334155;white-space:pre-wrap}
.bulletin-actions{white-space:nowrap}
.home-calendar-card h3,.home-chart-card h3{margin:0 0 12px;color:#1e3a5f}
.cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.cal-header h3{margin:0}
.cal-legend{display:flex;gap:16px;font-size:13px;color:#475569;margin-bottom:10px}
.cal-weekdays,.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.cal-weekdays span{text-align:center;font-size:12px;color:#64748b;padding:6px 0}
.cal-cell{min-height:64px;border:1px solid #e2e8f0;border-radius:8px;padding:6px;background:#fff;cursor:default}
.cal-cell.empty{border:0;background:transparent}
.cal-cell.has-deadline{cursor:pointer}
.cal-cell.today{outline:2px solid #2563eb}
.cal-cell .day-num{display:block;font-size:13px;font-weight:600;color:#334155}
.day-marks{display:flex;gap:4px;margin-top:8px;flex-wrap:wrap}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%}
.dot.official{background:#7f1d1d}
.dot.designated{background:#fca5a5}
.dot.todo{background:#7c3aed}
.dot.contract-end{background:#2563eb}
.official-text{color:#7f1d1d;font-weight:600}
.designated-text{color:#ef4444;font-weight:600}
.contract-end-text{color:#2563eb;font-weight:600}
.todo-text{color:#7c3aed;font-weight:600}
.cal-day-detail{margin-top:16px;border-top:1px solid #e2e8f0;padding-top:12px}
.cal-day-detail h4{margin:0 0 8px;font-size:14px;color:#1e3a5f}
.cal-day-detail ul{list-style:none;margin:0;padding:0}
.cal-day-detail li{padding:8px 0;border-bottom:1px solid #f1f5f9}
.cal-day-detail .meta{display:block;font-size:12px;color:#64748b;margin-top:2px}
.cal-day-detail .muted{color:#94a3b8}
.chart-wrap{max-width:100%;margin:0 auto 16px;height:280px;position:relative}
.chart-wrap.tall{height:320px}
.chart-wrap canvas{display:block;width:100%!important;height:100%!important}
.dashboard-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:14px}
.dashboard-filters label{font-size:13px;color:#475569;display:flex;align-items:center;gap:6px}
.dashboard-filters select{padding:6px 10px;border:1px solid #cbd5e1;border-radius:6px;font-size:13px}
.dashboard-section{margin-bottom:18px}
.home-analysis-stack{display:flex;flex-direction:column;gap:18px}
.stat-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.stat-chip{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0;text-decoration:none;color:#243044}
.stat-chip b{font-size:22px;color:#153e75}
.stat-chip span{font-size:12px;color:#64748b}
.stat-chip.danger{background:#fef2f2;border-color:#fecaca}
.stat-chip.danger b{color:#7f1d1d}
.revenue-stat-links{grid-template-columns:1fr;margin-top:12px}
.stat-chip-total{text-align:center;padding:16px;background:#eff6ff;border-color:#bfdbfe}
.stat-chip-total b{font-size:28px;color:#1d4ed8}
.inline-check{display:flex;align-items:center;gap:6px;font-size:13px;color:#475569}
.inline-check input{width:auto}
.workflow-assign-layout{display:grid;grid-template-columns:260px 1fr;gap:18px;align-items:start}
@media (max-width:900px){.workflow-assign-layout{grid-template-columns:1fr}}
.workflow-cascade-layout{display:grid;grid-template-columns:220px 220px minmax(0,1fr);gap:16px;align-items:start}
@media (max-width:1100px){.workflow-cascade-layout{grid-template-columns:1fr}}
.workflow-cascade-col{min-width:0}
.workflow-cascade-head{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.workflow-cascade-head strong{color:#1e3a5f}
.workflow-cascade-item{display:flex;align-items:center;gap:8px;width:100%;border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:8px;padding:8px 10px;cursor:pointer;text-align:left}
.workflow-cascade-item:hover{border-color:#c4b5fd;background:#faf5ff}
.workflow-cascade-item.active{border-color:#7c3aed;background:#f5f3ff;color:#5b21b6;font-weight:600}
.workflow-cascade-item .cascade-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workflow-cascade-item .cascade-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;flex:0 0 auto;justify-content:flex-end;max-width:58%}
.workflow-step-table tbody tr.workflow-step-row{cursor:default}
.workflow-step-table tbody tr.workflow-step-row.is-draggable{cursor:grab}
.workflow-step-table tbody tr.workflow-step-row.is-dragging{opacity:.55;background:#f5f3ff}
.workflow-step-table tbody tr.workflow-step-row.drop-before td{box-shadow:inset 0 2px 0 #7c3aed}
.workflow-step-table tbody tr.workflow-step-row.drop-after td{box-shadow:inset 0 -2px 0 #7c3aed}
.workflow-step-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:22px;color:#94a3b8;user-select:none;font-size:14px;letter-spacing:-1px;cursor:grab}
.workflow-step-row.is-draggable .workflow-step-drag-handle:active{cursor:grabbing}
.workflow-step-order{font-variant-numeric:tabular-nums;font-weight:700;color:#475569}
.workflow-step-desc-cell{color:#94a3b8;font-size:13px;line-height:1.45;font-weight:400;max-width:280px;word-break:break-word}
.workflow-cascade-item .cascade-edit,
.workflow-cascade-item .cascade-del{padding:2px 8px;font-size:12px;line-height:1.2}
.workflow-cascade-steps table{width:100%;font-size:13px}
.workflow-assign-user-list{display:flex;flex-direction:column;gap:6px;max-height:520px;overflow:auto;padding-right:4px}
.workflow-assign-user-item{display:block;width:100%;text-align:left;border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:8px;padding:10px 12px;cursor:pointer}
.workflow-assign-user-item:hover{border-color:#c4b5fd;background:#faf5ff}
.workflow-assign-user-item.active{border-color:#7c3aed;background:#f5f3ff;color:#5b21b6;font-weight:600}
.workflow-assign-user-item .share-badge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;background:#ede9fe;color:#5b21b6;font-size:11px;font-weight:600}
.data-share-user-item{display:flex;align-items:center;gap:10px}
.data-share-user-main{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;flex:1;text-align:left}
.data-share-user-main .workflow-assign-user-name{display:block;font-weight:600;word-break:break-word}
.data-share-user-sub{display:block;font-size:12px;word-break:break-all}
.data-share-user-item .data-share-mini-badge{flex:0 0 auto;margin-left:0;white-space:nowrap}
.share-outgoing-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.share-outgoing-head h3{margin:0;line-height:1.35;font-size:18px}
.share-outgoing-hint{margin:0;padding-top:3px;font-size:12px;line-height:1.35;color:#64748b;flex:1;min-width:180px}
.data-share-auto-card{border-color:#d9e7e2;background:linear-gradient(165deg,#f7fbf9 0%,#ffffff 70%)}
.data-share-chip-list{display:flex;flex-wrap:wrap;gap:10px;min-height:28px}
.data-share-chip{display:inline-flex;flex-direction:column;gap:2px;min-width:140px;padding:10px 12px;border-radius:12px;border:1px solid #e2e8f0;background:#fff;box-shadow:0 4px 12px rgba(15,23,42,.04)}
.data-share-chip strong{font-size:13px;color:#1e293b}
.data-share-chip small{font-size:11px;color:#64748b}
.data-share-chip em{font-style:normal;font-size:11px;font-weight:700;color:#0f766e}
.data-share-chip.auto{border-color:#b7ddd3;background:#f3faf7}
.data-share-chip.incoming em{color:#5b4b8a}
.data-share-mini-badge{margin-left:auto;font-size:10px;font-weight:700;color:#166534;background:#dcfce7;padding:2px 6px;border-radius:999px}
.data-share-detail-card{padding:14px 16px;border:1px dashed #d9d0ea;border-radius:12px;background:#faf8ff}
.data-share-detail-card p{margin:0 0 8px;color:#334155;line-height:1.5}
.data-share-detail-card ul{margin:0 0 10px 18px;padding:0}
.data-share-status{font-weight:700}
.data-share-status.on{color:#166534}
.data-share-status.off{color:#64748b}
.data-share-layout{align-items:stretch}
.data-share-resource-picker{max-height:420px;overflow:auto;border:1px solid #e8e4f3;border-radius:12px;background:#fbfaff;padding:8px;text-align:left}
.data-share-resource-item{display:flex;align-items:center;justify-content:flex-start;gap:12px;width:100%;box-sizing:border-box;padding:10px 12px;border-bottom:1px solid #efeaf8;cursor:pointer;text-align:left;margin:0}
.data-share-resource-item:last-child{border-bottom:0}
.data-share-resource-item:hover{background:#f3effc}
.data-share-resource-item input[type=checkbox]{width:auto;min-width:16px;flex:0 0 auto;margin:0;padding:0;border:0;border-radius:0;background:transparent;accent-color:#7c3aed}
.data-share-resource-item .data-share-resource-meta,
.data-share-resource-item span{display:flex;flex-direction:column;align-items:flex-start;gap:2px;flex:1;min-width:0;text-align:left}
.data-share-resource-item strong{font-size:13px;color:#1e293b;font-weight:600;text-align:left}
.data-share-resource-item small{display:block;text-align:left}
.data-share-selected-count{margin:10px 8px 4px;font-size:12px}
.data-share-pager{margin-top:12px}
.data-share-pager-inner{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.data-share-page-jump{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#475569}
.data-share-page-jump select{width:auto;min-width:96px;padding:6px 8px;font-size:13px}
.account-display-edit{display:flex;align-items:center;gap:8px;min-width:180px}
.account-display-edit input{width:140px;min-width:0;padding:7px 9px;font-size:13px}
.account-display-edit button{flex:0 0 auto}
.data-share-incoming-list{display:flex;flex-direction:column;gap:10px}
.data-share-incoming-item{padding:10px 12px;border:1px solid #e8e4f3;border-radius:10px;background:#fff}
.data-share-incoming-item strong{font-size:13px;color:#1e293b}
.data-share-incoming-item .muted{font-size:12px;line-height:1.45}
.share-user-search-row{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.share-user-search-row input{flex:1;min-width:0;width:auto}
.incoming-share-list{display:flex;flex-direction:column;gap:10px}
.incoming-share-item{border:1px solid #e2e8f0;border-radius:10px;padding:12px 14px;background:#f8fafc}
.incoming-share-item strong{display:block;margin-bottom:6px;color:#1e3a5f}
.incoming-share-item .muted{font-size:13px;line-height:1.5}
.workflow-board-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.workflow-board-group{border:1px solid #e2e8f0;border-radius:10px;padding:12px 14px;background:#f8fafc}
.workflow-board-group h4{margin:0 0 10px;font-size:14px;color:#1e3a5f}
.workflow-board-check{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:13px;color:#334155;cursor:pointer}
.workflow-board-check:last-child{margin-bottom:0}
.workflow-board-check input{width:auto}
.overdue-row{background:#fff1f2}
.system-page h2{margin:0}
.system-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px;flex-wrap:wrap}
.system-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.workflow-hub-actions{display:flex;flex-direction:column;gap:10px}
.workflow-hub-actions button{width:100%;justify-content:center}
.system-layout{display:grid;grid-template-columns:220px 1fr;gap:18px;align-items:start}
.system-sidebar{background:#fff;border-radius:10px;box-shadow:0 3px 14px #00000014;padding:16px}
.sidebar-block h4{margin:0 0 10px;color:#1e3a5f;font-size:14px}
.system-sidebar .system-nav-link{display:block;width:100%;text-align:left;border:0;background:#eff6ff;color:#1e3a5f;border-radius:8px;padding:10px 12px;margin-bottom:8px;cursor:pointer}
.system-sidebar .system-nav-link.active{background:#2563eb;color:#fff}
.system-main{padding:18px}
.system-toolbar{display:flex;gap:8px;justify-content:flex-end;margin-bottom:14px;flex-wrap:wrap}
.system-toolbar input,.system-toolbar select{width:220px}
.member-cell{display:flex;align-items:center;gap:12px}
.member-avatar{width:40px;height:40px;border-radius:50%;background:#2563eb;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}
.member-cell small{display:block;color:#64748b}
.role-select{min-width:120px}
.status-on{color:#15803d;font-weight:600}
.status-off{color:#b91c1c;font-weight:600}
.disabled-row{opacity:.72;background:#f8fafc}
.role-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}
.role-card{background:#fff;border-radius:10px;box-shadow:0 3px 14px #00000014;padding:18px}
.role-card h4{margin:0 0 8px;color:#1e3a5f}
.role-card p{margin:0 0 12px;color:#64748b;font-size:13px;min-height:40px}
.role-count{font-size:22px;font-weight:700;color:#153e75;margin-bottom:12px}
.muted{color:#64748b;margin:6px 0 0}
.contract-archive-section .contract-archive-label{font-size:11px;padding:4px 8px}
.contract-archive-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px}
.contract-archive-filename{font-size:12px;color:#64748b;line-height:1.4}
.contract-archive-note{margin-top:4px;font-size:11px;color:#94a3b8;line-height:1.4}
.row-actions{white-space:nowrap}
.case-add-row-actions{
  display:inline-flex;align-items:center;flex-wrap:nowrap;gap:6px;white-space:nowrap;
}
.case-add-row-actions .small{margin-right:0}
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--brand-purple-dark),var(--brand-purple-light))}
.login-card{width:380px;background:#fff;padding:34px;border-radius:14px;box-shadow:0 16px 50px #0005}
.login-card h1{margin:0;color:var(--brand-purple-dark)}
.login-card p{color:#64748b}
.login-card input{margin:8px 0}
.login-card button{width:100%;margin:12px 0;background:var(--brand-purple);color:#fff}
.login-card small{color:#64748b}
.dashboard-hero{
  position:relative;margin-bottom:22px;padding:8px 0 4px;
}
.dashboard-hero-top{
  position:relative;display:flex;align-items:flex-start;justify-content:space-between;
  gap:20px;margin-bottom:18px;min-height:108px;
}
.dashboard-welcome-text{
  position:relative;z-index:2;flex:1;padding:8px 0;
}
.dashboard-welcome-text h2{margin:0 0 8px;font-size:28px;font-weight:700;color:#1e293b}
.dashboard-welcome-text p{margin:0;color:#64748b;font-size:14px;line-height:1.6}
.dashboard-hero-visual{
  position:relative;flex-shrink:0;width:min(220px,32vw);height:120px;
}
.hero-building-ring{
  position:absolute;right:-8px;top:50%;transform:translateY(-50%);
  width:180px;height:180px;border-radius:50%;
  border:14px solid var(--brand-purple);
  background:linear-gradient(135deg,#4b2a85,#7b52ee);
  box-shadow:0 12px 32px rgba(49,16,117,.22);overflow:hidden;
}
.hero-building-ring img{width:100%;height:100%;object-fit:cover;display:block}
.dashboard-stats{
  display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:16px;
}
.dashboard-stat-card{
  position:relative;display:flex;align-items:center;gap:14px;
  background:rgba(255,255,255,.97);border-radius:14px;padding:18px 44px 18px 18px;
  border:1px solid rgba(238,240,245,.95);box-shadow:var(--card-shadow);
  text-decoration:none;color:inherit;transition:transform .15s ease,box-shadow .15s ease;
}
.dashboard-stat-card:hover{
  transform:translateY(-2px);box-shadow:0 8px 24px rgba(49,16,117,.12);
}
.stat-icon-wrap{
  width:48px;height:48px;border-radius:50%;flex-shrink:0;
  background:var(--brand-purple);color:#fff;
  display:flex;align-items:center;justify-content:center;
}
.stat-icon-wrap svg{width:22px;height:22px}
.stat-body{min-width:0;flex:1}
.dashboard-stat-card .stat-label{font-size:13px;color:#64748b;margin-bottom:4px}
.dashboard-stat-card .stat-value{font-size:26px;font-weight:700;color:#1e293b;line-height:1.1}
.dashboard-stat-card .stat-meta{font-size:12px;color:#94a3b8;margin-top:6px}
.dashboard-stat-card .stat-meta .trend.up{color:#dc2626}
.dashboard-stat-card .stat-meta .trend.down{color:#16a34a}
.dashboard-stat-card .stat-meta .trend.flat{color:#94a3b8}
.stat-chevron{
  position:absolute;right:16px;top:50%;transform:translateY(-50%);
  width:18px;height:18px;color:var(--brand-purple);opacity:.75;
}
.dashboard-bulletin{
  display:flex;align-items:center;gap:16px;
  background:rgba(255,255,255,.97);border-radius:14px;padding:16px 20px;
  border:1px solid rgba(238,240,245,.95);box-shadow:var(--card-shadow);
}
.dashboard-bulletin-icon{
  width:44px;height:44px;border-radius:12px;flex-shrink:0;
  background:var(--brand-purple-soft);color:var(--brand-purple);
  display:flex;align-items:center;justify-content:center;
}
.dashboard-bulletin-icon svg{width:22px;height:22px}
.dashboard-bulletin-body{flex:1;min-width:0}
.dashboard-bulletin-body h3{margin:0 0 6px;font-size:15px;color:#1e293b}
.dashboard-bulletin-preview p{margin:0;font-size:13px;color:#64748b;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-bulletin-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.dashboard-bulletin-more{
  border:0;background:transparent;color:var(--brand-purple);font:inherit;
  font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap;padding:8px 4px;
}
.dashboard-bulletin-more span{font-size:18px;line-height:1}
.bulletin-card-full{margin-top:0}
@media(max-width:900px){
  .dashboard-stats{grid-template-columns:1fr 1fr}
  .topbar-menu-btn{display:flex}
  body:has(.app-chrome) main{margin-left:0;padding-top:calc(var(--topbar-h) + 16px)}
  .app-topbar{left:0}
  .app-sidebar{transform:translateX(-100%);transition:transform .25s ease}
  body.sidebar-open .app-sidebar{transform:translateX(0)}
  body.sidebar-open .sidebar-overlay{
    display:block;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:35;
  }
  .toolbar{display:block}.toolbar>div{margin-top:12px}
  .grid,.form-grid,.form-grid.cols-3,.grid-3{grid-template-columns:1fr}
  .wide{grid-column:auto}
  main{padding:18px}
  body:has(.app-chrome) main{padding:calc(var(--topbar-h) + 12px) 16px 16px}
  .toolbar input,.toolbar select,.search-bar input{width:100%;margin:4px 0}
  .kv-row{grid-template-columns:1fr}
  .kv-label{border-bottom:1px solid #bfdbfe}
  .home-layout,.stat-links{grid-template-columns:1fr}
  .todo-form{grid-template-columns:1fr}
  .todo-actions{width:100%;justify-content:flex-end}
  .todo-workspace{flex-direction:column;min-height:auto}
  .todo-detail-pane{width:100%;border-left:0;border-top:1px solid #e8eaf0;max-height:55vh}
  .system-layout,.role-cards{grid-template-columns:1fr}
  .cal-cell{min-height:48px}
  .dashboard-stats{grid-template-columns:1fr}
  .dashboard-hero-top{flex-direction:column;min-height:0}
  .dashboard-hero-visual{width:100%;height:100px;margin-top:4px}
  .hero-building-ring{right:12px;width:140px;height:140px;border-width:10px}
  .dashboard-bulletin{flex-direction:column;align-items:flex-start}
  .dashboard-bulletin-actions{width:100%;justify-content:space-between}
}

#caseRecordReportEmpty{font-size:12px;margin-top:4px}
.issue-solution-toolbar{margin-bottom:8px}
.issue-solution-table{width:100%;border-collapse:collapse;background:#fff}
.issue-solution-table th,.issue-solution-table td{border:1px solid #dbeafe;padding:8px;vertical-align:top}
.issue-solution-table th{background:#eff6ff;color:#1e3a5f;font-size:13px;text-align:center}
.issue-solution-table textarea{width:100%;min-height:56px;resize:vertical;margin:0}

.workflow-toolbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.workflow-case-select{display:flex;align-items:center;gap:8px;font-size:13px;color:#475569;margin:0}
.workflow-case-select select{width:auto;min-width:120px}
.workflow-stage{padding:18px 20px}
.workflow-stage-head{display:flex;align-items:flex-start;gap:14px;margin-bottom:12px}
.workflow-stage-code{
  width:42px;height:42px;border-radius:12px;background:var(--brand-purple);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:18px;flex-shrink:0;
}
.workflow-stage-head h3{margin:0;font-size:18px}
.workflow-stage-head .muted{margin:4px 0 0;font-size:13px}
.workflow-step-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.workflow-step{
  border:1px solid #e2e8f0;border-radius:10px;padding:12px 14px;background:#fff;
}
.workflow-step.done{background:#f8fafc;opacity:.85}
.workflow-step.current{border-color:var(--brand-purple);box-shadow:0 0 0 2px rgba(91,33,182,.15);background:#faf5ff}
.workflow-step-main{display:flex;align-items:center;justify-content:space-between;gap:10px}
.workflow-step-title{display:flex;align-items:flex-end;gap:10px;min-width:0;flex-wrap:wrap}
.workflow-step-desc{font-size:12px;line-height:1.45;color:#64748b;margin-left:4px;font-weight:400;padding-bottom:1px}
.workflow-step-no{
  width:26px;height:26px;border-radius:999px;background:#ede9fe;color:var(--brand-purple);
  display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0;
  align-self:center;
}
.workflow-step.current .workflow-step-no{background:var(--brand-purple);color:#fff}
.workflow-step-link{color:var(--brand-purple);text-decoration:underline;text-underline-offset:2px}
.workflow-step-link:hover{color:var(--brand-purple-dark)}
.workflow-case-list{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}
.workflow-case-item{
  border:2px solid #c4b5fd;border-radius:8px;padding:10px 12px;background:#fff;
  box-shadow:0 1px 2px rgba(91,33,182,.06);
}
.workflow-case-item:hover{border-color:#a78bfa;background:#faf5ff}
.workflow-case-row{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.workflow-case-actions{display:flex;gap:6px;flex-shrink:0}
.workflow-case-search-label{margin:0 0 6px;font-size:14px;font-weight:600;color:#334155}
.workflow-case-search-hint{margin:0 0 8px;font-size:13px;color:#64748b}
.workflow-case-search-hint.error{color:#b91c1c}
.workflow-case-search{display:flex;gap:8px}
.workflow-case-search input{flex:1}
.workflow-case-search-results{display:flex;flex-direction:column;gap:6px;max-height:240px;overflow:auto;margin-top:8px}
.workflow-case-search-item{
  display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;text-align:left;
  border:1px solid #e2e8f0;border-radius:8px;padding:8px 10px;background:#fff;cursor:pointer;
}
.workflow-case-search-item:hover,.workflow-case-search-item.active{border-color:var(--brand-purple);background:#faf5ff}

/* 收發文列表操作按鈕 */
.doc-actions{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;max-width:280px}
.workflow-case-summary{margin-top:4px;font-size:12px;line-height:1.4;white-space:pre-wrap;word-break:break-word}
.workflow-case-message-block{margin-top:14px;padding-top:12px;border-top:1px solid #e2e8f0}
.workflow-case-message-label{margin:0 0 8px;font-size:13px;font-weight:600;color:#334155}
.workflow-case-message-thread{max-height:160px;margin-bottom:10px}
.workflow-case-link{display:flex;flex-wrap:wrap;gap:8px;color:#1e293b;text-decoration:none;min-width:0;flex:1}
.workflow-case-link strong{color:var(--brand-purple-dark)}
.workflow-case-link:hover span{text-decoration:underline}
.workflow-case-meta{font-size:12px;margin-top:4px}
.workflow-case-desc{font-size:12px;line-height:1.45;color:#94a3b8;margin-top:2px;font-weight:400;word-break:break-word}
.workflow-step-main strong{font-size:15px;color:#1e293b}
.workflow-step p{margin:6px 0 0}
.workflow-badge{
  font-size:12px;padding:3px 8px;border-radius:999px;background:#e2e8f0;color:#475569;white-space:nowrap;
}
.workflow-step.current .workflow-badge{background:var(--brand-purple);color:#fff}
.workflow-step.done .workflow-badge{background:#dcfce7;color:#166534}

/* profile page */
.profile-layout{align-items:start}
.profile-main{min-width:0;display:flex;flex-direction:column;gap:18px}
.profile-hero-card{margin-bottom:0}
.profile-hero{display:grid;grid-template-columns:auto 1fr 1.1fr;gap:24px;align-items:start}
.profile-avatar-wrap{position:relative;width:112px;height:112px;flex-shrink:0}
.profile-avatar{width:112px;height:112px;border-radius:50%;background:#e2e8f0;color:#475569;display:flex;align-items:center;justify-content:center;font-size:42px;font-weight:700;background-size:cover;background-position:center;overflow:hidden;border:3px solid #fff;box-shadow:0 8px 24px rgba(15,23,42,.12)}
.profile-avatar.has-image{font-size:0;color:transparent}
.profile-avatar-add{position:absolute;right:2px;bottom:2px;width:34px;height:34px;border-radius:50%;border:0;background:var(--brand-purple);color:#fff;font-size:22px;line-height:1;cursor:pointer;box-shadow:0 4px 12px rgba(91,33,182,.35);display:flex;align-items:center;justify-content:center;padding:0}
.profile-avatar-add:hover{background:var(--brand-purple-light)}
.profile-hero-meta{min-width:0;padding-top:8px}
.profile-name-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.profile-name-row strong{font-size:24px;color:#0f172a}
.profile-role-badge{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;background:var(--brand-purple-soft);color:var(--brand-purple-dark);font-size:12px;font-weight:600}
.profile-contact-list{display:grid;gap:10px}
.profile-contact-list label{font-size:12px;color:#64748b;display:flex;flex-direction:column;gap:4px}
.profile-bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.profile-card-title{margin:0 0 14px;font-size:16px;font-weight:700;color:#1e293b;line-height:1.4}
.profile-team-name{font-size:16px;font-weight:700;color:#1e293b;line-height:1.4}
.profile-team-manager{margin:6px 0 10px;font-size:16px;font-weight:700;color:#1e293b;line-height:1.4}
.profile-team-members{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:6px}
.profile-team-members li{padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;font-size:13px;color:#334155}
.profile-proxy-card{margin-top:0}
.profile-proxy-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.profile-proxy-subtitle{margin:0 0 4px;font-size:15px;font-weight:700;color:#1e293b}
.profile-proxy-hint{margin:0 0 12px;font-size:12px}
.profile-proxy-add-row{display:flex;gap:8px;align-items:center;margin-bottom:12px;justify-content:flex-end}
.profile-proxy-add-row .small{flex-shrink:0;white-space:nowrap}
.profile-proxy-picker{
  max-height:180px;overflow:auto;border:1px solid #e2e8f0;border-radius:8px;
  background:#fff;padding:6px;margin-bottom:10px;display:flex;flex-direction:column;gap:2px;
}
.profile-proxy-check{
  display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:6px;
  font-size:13px;color:#334155;cursor:pointer;margin:0;
}
.profile-proxy-check:hover{background:#f8fafc}
.profile-proxy-check input{width:auto;margin:0;flex-shrink:0}
.profile-proxy-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.profile-proxy-list li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc}
.profile-proxy-item-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.profile-proxy-item-main strong{font-size:14px;color:#1e293b}
.profile-proxy-item-main .muted{font-size:12px}
@media (max-width:980px){.profile-hero{grid-template-columns:1fr}.profile-bottom-grid{grid-template-columns:1fr}.profile-proxy-grid{grid-template-columns:1fr}}

/* performance analysis */
.performance-toolbar{flex-wrap:wrap}
.performance-toolbar label{display:flex;align-items:center;gap:6px;font-size:13px;color:#475569;white-space:nowrap}
.performance-toolbar select{width:110px}
.performance-hierarchy-card{margin-bottom:14px}
.performance-hierarchy-card .section-head,.performance-meta-card .section-head,.performance-table-card .section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}
.performance-hierarchy-card .section-head h3,.performance-meta-card .section-head h3,.performance-table-card .section-head h3,.performance-chart-card h3{margin:0;font-size:15px;font-weight:600;color:#1e293b}
.performance-hierarchy-card .section-head .muted,.performance-meta-card .section-head .muted,.performance-table-card .section-head .muted{margin:0;font-size:12px}
.performance-hierarchy-filters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.performance-hierarchy-filters label{font-size:12px;color:#64748b;display:flex;flex-direction:column;gap:4px}
.performance-hierarchy-filters select{width:100%}
.performance-meta-card{margin-bottom:14px}
.performance-meta-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.performance-target-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.performance-meta-grid label{font-size:12px;color:#64748b;display:flex;flex-direction:column;gap:4px}
.performance-trend-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px;align-items:start}
.performance-trend-card{margin:0;padding:16px}
.performance-trend-card h3{margin:0 0 12px;font-size:15px;font-weight:600;color:#1e293b}
.performance-case-diff-card{margin-bottom:14px;padding:16px 18px;border:1px solid #e8e4f3;background:linear-gradient(165deg,#fbfaff 0%,#f4f7fb 55%,#eef6f4 100%);box-shadow:0 10px 28px rgba(55,40,90,.06)}
.performance-case-diff-card .section-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px}
.performance-case-diff-card .section-head h3{margin:0;font-size:15px;font-weight:600;color:#1e293b}
.performance-case-diff-card .section-head .muted{margin:0;font-size:12px}
.perf-case-diff-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.perf-case-diff-tile{position:relative;display:flex;flex-direction:column;gap:10px;min-width:0;padding:14px 14px 12px;border-radius:14px;background:rgba(255,255,255,.88);border:1px solid rgba(226,232,240,.95);box-shadow:0 6px 16px rgba(15,23,42,.04);overflow:hidden}
.perf-case-diff-tile::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--tile-accent,#94a3b8)}
.perf-case-diff-tile.tone-patent{--tile-accent:#5b4b8a}
.perf-case-diff-tile.tone-trademark{--tile-accent:#1d4ed8}
.perf-case-diff-tile.tone-legal{--tile-accent:#0f766e}
.perf-case-diff-tile.tone-consultant{--tile-accent:#b45309}
.perf-case-diff-tile.tone-planning{--tile-accent:#64748b}
.perf-case-diff-tile.tone-total{--tile-accent:#334155;background:linear-gradient(180deg,rgba(241,236,249,.95),rgba(255,255,255,.92))}
.perf-case-diff-head{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;letter-spacing:.04em;color:#475569}
.perf-case-diff-dot{width:8px;height:8px;border-radius:50%;background:var(--tile-accent,#94a3b8);box-shadow:0 0 0 3px color-mix(in srgb,var(--tile-accent,#94a3b8) 18%,transparent)}
.perf-case-diff-value{font-size:28px;line-height:1;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.03em;color:#1e293b}
.perf-case-diff-value.pos{color:#166534}
.perf-case-diff-value.neg{color:#b91c1c}
.perf-case-diff-value.flat{color:#64748b}
.perf-case-diff-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding-top:8px;border-top:1px dashed #e2e8f0}
.perf-case-diff-meta div{display:flex;flex-direction:column;gap:2px;min-width:0}
.perf-case-diff-meta span{font-size:10px;color:#94a3b8;letter-spacing:.02em}
.perf-case-diff-meta b{font-size:13px;font-weight:700;color:#334155;font-variant-numeric:tabular-nums}
.performance-charts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px}
.performance-chart-card{margin:0;padding:16px}
.performance-chart-box{position:relative;height:260px;margin-top:8px}
.performance-kpi-card{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px;padding:14px 16px}
.performance-kpi{display:flex;flex-direction:column;gap:4px;min-width:0}
.performance-kpi .kpi-label{font-size:12px;color:#64748b}
.performance-kpi strong{font-size:20px;font-weight:700;color:#1e293b;font-variant-numeric:tabular-nums;letter-spacing:-0.02em}
.performance-table-card{overflow:hidden;margin-bottom:14px;border:1px solid #e8e4f3;box-shadow:0 8px 24px rgba(55,40,90,.05)}
.performance-table-wrap{overflow:auto;max-width:100%;border-radius:0 0 12px 12px}
.performance-table{min-width:1400px;border-collapse:separate;border-spacing:0;font-size:12.5px}
.performance-table-pretty th,.performance-table-pretty td{padding:10px 12px;border-bottom:1px solid #ece8f5;white-space:nowrap}
.performance-table-pretty th{position:sticky;top:0;z-index:2;background:linear-gradient(180deg,#f4f0fb 0%,#ebe4f8 100%);color:#43365f;font-size:11px;font-weight:700;letter-spacing:.02em;text-align:left;border-bottom:1px solid #d9d0ea}
.performance-table-pretty td.num{text-align:right;font-variant-numeric:tabular-nums;color:#334155}
.performance-table-center th{text-align:center}
.performance-table-center td.num,.performance-table-center td.perf-quarter-cell.num{text-align:center}
.performance-table-center td.num .perf-chip,.performance-table-center .perf-chip{justify-content:center;margin:0 auto}
.performance-table-center .perf-name-cell{text-align:left}
.performance-table-pretty td.perf-quarter-cell{vertical-align:middle;text-align:center;background:inherit}
.performance-table-pretty td.perf-quarter-cell.num{text-align:center}
.performance-table-pretty td.perf-quarter-cell .perf-chip{justify-content:center;margin:0 auto}
.performance-table-pretty .sticky-col.perf-quarter-cell{text-align:center}
.performance-table-pretty .sticky-col{position:sticky;left:0;z-index:1;background:#fff}
.performance-table-pretty .sticky-col-2{left:64px}
.performance-table-pretty thead .sticky-col{z-index:3;background:linear-gradient(180deg,#f4f0fb 0%,#ebe4f8 100%)}
.performance-table-pretty tbody tr:hover td{background:#faf8ff}
.performance-table-pretty tbody tr:hover .sticky-col{background:#faf8ff}
.performance-table-pretty .perf-q1 td,.performance-table-pretty .perf-q1 .sticky-col{background:#fcfbff}
.performance-table-pretty .perf-q2 td,.performance-table-pretty .perf-q2 .sticky-col{background:#f8fafc}
.performance-table-pretty .perf-q3 td,.performance-table-pretty .perf-q3 .sticky-col{background:#fcfbff}
.performance-table-pretty .perf-q4 td,.performance-table-pretty .perf-q4 .sticky-col{background:#f8fafc}
.performance-table-pretty .perf-total td{font-weight:700;background:#f1ecf9;border-top:2px solid #d4c8ea}
.performance-table-pretty .perf-total .sticky-col{background:#f1ecf9}
.perf-q-badge{display:inline-flex;align-items:center;justify-content:center;min-width:36px;padding:2px 8px;border-radius:999px;background:#5b4b8a;color:#fff;font-size:11px;font-weight:700}
.perf-level-tag{display:inline-flex;padding:2px 8px;border-radius:6px;background:#eee9f8;color:#5b4b8a;font-size:11px;font-weight:600}
.perf-badge{display:inline-flex;margin-left:8px;padding:2px 8px;border-radius:6px;background:#eee9f8;color:#5b4b8a;font-size:11px;font-weight:600;vertical-align:middle}
.perf-name-cell{font-weight:600;color:#1e293b}
.perf-drill-row{cursor:pointer}
.perf-drill-row:hover td{background:#f3effc !important}
.perf-chip{display:inline-flex;min-width:4.5em;justify-content:flex-end;padding:2px 8px;border-radius:999px;font-weight:600;font-variant-numeric:tabular-nums}
.perf-chip.perf-pos{background:#dcfce7;color:#166534}
.perf-chip.perf-neg{background:#fee2e2;color:#b91c1c}
.perf-pos{color:#166534}
.perf-neg{color:#b91c1c}
@media (max-width:1100px){
  .performance-hierarchy-filters{grid-template-columns:1fr 1fr}
}
@media (max-width:1200px){
  .perf-case-diff-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:980px){
  .performance-meta-grid,.performance-charts,.performance-kpi-card,.performance-trend-grid{grid-template-columns:1fr 1fr}
  .perf-case-diff-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .performance-meta-grid,.performance-charts,.performance-kpi-card,.performance-hierarchy-filters,.performance-trend-grid{grid-template-columns:1fr}
  .perf-case-diff-grid{grid-template-columns:1fr}
  .performance-chart-box{height:220px}
}

/* calendar page */
.calendar-page-card{padding:18px}
.calendar-toolbar-actions{display:flex;gap:8px;align-items:center}
.calendar-google-banner{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc;margin-bottom:14px}
.calendar-google-banner.connected{border-color:#bbf7d0;background:#f0fdf4}
.calendar-google-banner.warn{border-color:#fde68a;background:#fffbeb}
.calendar-google-banner p{margin:4px 0 0}
.calendar-page-grid .cal-cell{min-height:92px}
.calendar-page-grid .cal-cell.selected{outline:2px solid var(--brand-purple)}
.cal-marks{display:flex;gap:4px;margin-top:4px;min-height:10px}
.cal-legend .dot,.cal-marks .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}
.dot.official{background:#dc2626}
.dot.designated{background:#d97706}
.dot.todo{background:#2563eb}
.dot.local-event{background:#9333ea}
.dot.google{background:#16a34a}
.cal-mini.local-event{background:#f3e8ff;color:#6b21a8}
.cal-mini-list{margin-top:4px;display:flex;flex-direction:column;gap:2px}
.cal-mini{font-size:10px;line-height:1.2;padding:2px 4px;border-radius:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-mini.official{background:#fee2e2;color:#991b1b}
.cal-mini.designated{background:#ffedd5;color:#9a3412}
.cal-mini.todo{background:#dbeafe;color:#1d4ed8}
.cal-mini.google{background:#dcfce7;color:#166534}
.cal-more{font-size:10px;color:#64748b}

.calendar-google-actions{display:flex;gap:8px;align-items:center;flex-shrink:0}

.calendar-setup-card{margin:0 0 14px;padding:14px;border:1px dashed #cbd5e1;background:#fff}

.cal-legend{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.cal-legend-item{
  display:inline-flex;align-items:center;gap:6px;border:1px solid #e2e8f0;background:#fff;
  border-radius:999px;padding:5px 10px;font-size:12px;color:#334155;cursor:default;
}
.cal-legend-item.editable{cursor:pointer}
.cal-legend-item.editable:hover{border-color:#c4b5fd;background:#faf5ff;color:#5b21b6}
.calendar-color-swatches{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.calendar-color-swatch{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer;padding:0}
.calendar-color-swatch.active{border-color:#0f172a;box-shadow:0 0 0 2px #fff,0 0 0 4px #0f172a33}
.calendar-color-custom{display:inline-flex;align-items:center;gap:8px;font-size:13px}
.calendar-color-custom input[type=color]{width:36px;height:28px;padding:0;border:none;background:transparent;cursor:pointer}
.calendar-share-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.calendar-share-tab{
  border:1px solid #e2e8f0;background:#f8fafc;border-radius:8px;padding:7px 12px;font-size:13px;cursor:pointer;
  display:inline-flex;align-items:center;gap:6px;
}
.calendar-share-tab.active{background:#312e81;border-color:#312e81;color:#fff}
.share-badge{
  display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;
}
.calendar-share-tab.active .share-badge{background:#fff;color:#dc2626}
.calendar-share-search{display:flex;gap:8px;margin-bottom:10px}
.calendar-share-search input{flex:1}
.calendar-share-pick-list{list-style:none;margin:0;padding:0;max-height:260px;overflow:auto;border:1px solid #e2e8f0;border-radius:8px}
.calendar-share-pick-list li{padding:10px 12px;border-bottom:1px solid #f1f5f9;font-size:13px}
.calendar-share-pick-list li:last-child{border-bottom:0}
.share-pick-item{display:flex;justify-content:space-between;align-items:center;gap:10px;cursor:pointer}
.share-pick-item:hover{background:#f8fafc}
.share-pick-item.selected{background:#eef2ff;outline:1px solid #c7d2fe}
.share-pick-meta{color:#64748b;font-size:12px;flex-shrink:0}
.cal-mini.colored{color:#fff}
.cal-mini.editable-event{cursor:pointer}
.cal-mini.editable-event:hover{filter:brightness(.92)}
.cal-legend .dot.colored,.cal-marks .dot.colored{border-radius:50%}
.cal-event-row:hover{background:#f8fafc}
.event-cal-type-group{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.event-cal-type-btn{
  flex:1;min-width:140px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;
  background:#f8fafc;color:#334155;font-size:13px;cursor:pointer;text-align:center;
}
.event-cal-type-btn:hover{border-color:#c4b5fd;background:#faf5ff}
.event-cal-type-btn.active{border-color:#312e81;background:#312e81;color:#fff}
.event-cal-type-btn:disabled{opacity:.45;cursor:not-allowed}

.calendar-flow-steps{margin:8px 0 0;padding-left:18px;font-size:12px;line-height:1.6}
.calendar-setup-card summary{cursor:pointer;font-weight:700;color:#1e293b}

.auth-plan-picker{display:flex;flex-direction:column;gap:12px}
.auth-plan-card{display:block;border:1px solid #e2e8f0;border-radius:12px;padding:14px 16px;background:#fff;cursor:pointer;transition:border-color .15s,box-shadow .15s,background .15s}
.auth-plan-card:hover{border-color:#93c5fd;background:#f8fbff}
.auth-plan-card.active{border-color:#2563eb;background:#eff6ff;box-shadow:0 0 0 1px #2563eb33}
.auth-plan-card input.auth-plan-radio{position:absolute;opacity:0;pointer-events:none}
.auth-plan-title{font-size:16px;font-weight:700;color:#1e3a5f;margin-bottom:4px}
.auth-plan-desc{font-size:13px;color:#475569;line-height:1.5;margin-bottom:8px}
.auth-plan-groups{margin:0 0 8px;padding-left:18px;color:#334155;font-size:13px;line-height:1.6}
.auth-plan-hint{font-size:12px;color:#64748b}

.profile-invite-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.profile-invite-row input{flex:1;min-width:220px}

/* 系統功能管理總控台 */
.hub-badge{display:inline-flex;align-items:center;padding:6px 12px;border-radius:999px;background:#1e3a5f;color:#fff;font-size:12px;font-weight:600}
.hub-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:22px}
.hub-stat{background:rgba(255,255,255,.94);border:1px solid rgba(226,232,240,.95);border-radius:12px;padding:14px 16px;box-shadow:var(--card-shadow)}
.hub-stat-label{display:block;font-size:12px;color:#64748b;margin-bottom:6px}
.hub-stat-value{font-size:26px;line-height:1.1;color:#1e3a5f;font-weight:700}
.hub-stat-value-sm{font-size:18px}
.hub-section{margin-bottom:22px}
.hub-section-title{margin:0 0 4px;font-size:16px;color:#1e3a5f}
.hub-section-desc{margin:0 0 12px}
.hub-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.hub-tile{display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:14px;background:rgba(255,255,255,.96);border:1px solid rgba(226,232,240,.95);box-shadow:var(--card-shadow);text-decoration:none;color:inherit;transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease}
.hub-tile:hover{border-color:#93c5fd;transform:translateY(-1px);box-shadow:0 8px 22px rgba(37,99,235,.12)}
.hub-tile-muted{opacity:.96}
.hub-tile-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.hub-tile-icon svg{width:22px;height:22px}
.hub-tile-icon-auth{background:#ecfdf5;color:#047857}
.hub-tile-icon-users{background:#eff6ff;color:#1d4ed8}
.hub-tile-icon-org{background:#fff7ed;color:#c2410c}
.hub-tile-icon-plan{background:#ecfdf5;color:#047857}
.seat-options{display:flex;flex-wrap:wrap;gap:8px}
.seat-option{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafc;font-size:13px;font-weight:600;color:#1e293b;cursor:pointer}
.seat-option.active{border-color:#047857;background:#ecfdf5;color:#047857}
.seat-option.disabled{opacity:.45;cursor:not-allowed}
.hub-tile-icon-announce{background:#fef3c7;color:#b45309}
.hub-tile-icon-flow{background:#f5f3ff;color:#6d28d9}
.hub-tile-icon-profile{background:#f1f5f9;color:#475569}
.hub-tile-body{flex:1;min-width:0}
.hub-tile-body strong{display:block;font-size:15px;color:#1e3a5f;margin-bottom:4px}
.hub-tile-body span{display:block;font-size:13px;color:#64748b;line-height:1.45}
.hub-tile-go{font-size:12px;font-weight:600;color:#2563eb;white-space:nowrap}
@media (max-width:900px){.hub-stats,.hub-grid{grid-template-columns:1fr 1fr}}
@media (max-width:640px){.hub-stats,.hub-grid{grid-template-columns:1fr}}

.hub-stats-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.hub-stat-hint{display:block;font-size:11px;margin-top:6px}
.analytics-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px;margin-bottom:18px;padding:14px 16px;background:rgba(255,255,255,.92);border:1px solid rgba(226,232,240,.95);border-radius:12px}
.analytics-filter{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#64748b}
.analytics-filter select{min-width:120px;padding:8px 10px;border-radius:8px;border:1px solid #cbd5e1;background:#fff;color:#1e293b;font-size:14px}
.analytics-period{align-self:center;font-size:13px}
.analytics-totals{margin:-6px 0 18px;font-size:13px}
.analytics-charts{display:grid;grid-template-columns:1fr 1.2fr;gap:16px}
.analytics-panel{background:rgba(255,255,255,.94);border:1px solid rgba(226,232,240,.95);border-radius:14px;padding:16px 18px;box-shadow:var(--card-shadow)}
.analytics-chart-wrap{position:relative;height:260px;margin-top:8px}
.analytics-plan-legend{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.analytics-plan-row{display:flex;align-items:center;gap:10px;font-size:13px;color:#475569}
.analytics-plan-row strong{min-width:4.5em;color:#1e3a5f}
.analytics-plan-swatch{width:10px;height:10px;border-radius:3px;flex-shrink:0}
@media (max-width:900px){.analytics-charts{grid-template-columns:1fr}}

/* 業務筆記 */
.bn-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.bn-sub{margin:4px 0 0;font-size:13px}
.bn-toolbar-stats{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap}
.bn-month-stats{
  display:flex;flex-direction:column;justify-content:center;gap:4px;padding:10px 14px;border-radius:12px;
  background:rgba(49,16,117,.05);border:1px solid rgba(49,16,117,.14);color:var(--brand-purple-dark);min-width:160px;
}
.bn-month-label{font-size:12px;font-weight:600}
.bn-month-metrics{display:flex;flex-direction:column;gap:2px;font-size:13px}
.bn-month-metrics strong{font-size:16px;font-weight:700}
.bn-event-type-stats{
  display:flex;flex-direction:column;justify-content:center;gap:8px;padding:10px 14px;border-radius:12px;
  background:rgba(49,16,117,.05);border:1px solid rgba(49,16,117,.14);color:var(--brand-purple-dark);
  min-width:220px;max-width:560px;
}
.bn-event-score-summary{display:flex;flex-wrap:wrap;gap:10px 14px;font-size:13px}
.bn-event-score-summary strong{font-size:16px;font-weight:700}
.bn-score-up{color:#047857}
.bn-score-down{color:#b91c1c}
.bn-event-type-grid{display:flex;flex-wrap:wrap;gap:8px}
.bn-event-type-chip{
  display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:10px;
  background:#fff;border:1px solid rgba(49,16,117,.16);font-size:13px;
}
.bn-event-type-chip.is-clickable{cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}
.bn-event-type-chip.is-clickable:hover{border-color:rgba(49,16,117,.35);box-shadow:0 1px 4px rgba(49,16,117,.08)}
.bn-event-type-chip.is-active{border-color:var(--brand-purple-dark);background:rgba(49,16,117,.06)}
.bn-event-type-name{font-weight:600;color:#334155}
.bn-event-type-meta{font-size:12px;color:#64748b;white-space:nowrap}
.bn-event-type-meta strong{font-size:14px;font-weight:700;color:var(--brand-purple-dark)}
.bn-event-type-detail{
  margin-top:2px;padding-top:8px;border-top:1px dashed rgba(49,16,117,.18);
  display:flex;flex-direction:column;gap:8px;min-width:0;
}
.bn-event-type-detail[hidden]{display:none!important}
.bn-event-type-detail-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.bn-event-type-detail-head strong{font-size:13px;color:var(--brand-purple-dark)}
.bn-event-type-detail-head .bn-event-type-detail-close{
  flex-shrink:0;cursor:pointer;position:relative;z-index:2;
}
.bn-event-type-detail-list{
  list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;
  max-height:180px;overflow:auto;
}
.bn-event-type-detail-item{
  display:flex;align-items:flex-start;gap:8px;padding:8px 10px;border-radius:8px;
  background:#fff;border:1px solid rgba(49,16,117,.12);
}
.bn-event-type-detail-line{font-size:13px;color:#1e293b;line-height:1.45;word-break:break-word}
.bn-event-type-detail-when{font-size:12px;color:#64748b}
.bn-event-type-detail-title{font-size:13px;font-weight:600;color:#1e293b;word-break:break-word}
.bn-streak-badge{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 14px;border-radius:12px;
  background:rgba(49,16,117,.06);border:1px solid rgba(49,16,117,.18);color:var(--brand-purple-dark);
}
.bn-streak-badge.hot{background:#fef3c7;border-color:#f59e0b;color:#92400e}
.bn-streak-label{font-size:12px;font-weight:600}
.bn-streak-badge strong{font-size:22px;line-height:1}
.bn-streak-unit{font-size:12px}
.bn-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(240px,.8fr);gap:16px;align-items:start}
.bn-editor,.bn-recent{padding:18px 20px}
.bn-date-row{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.bn-date-label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#64748b}
.bn-type-inline select{min-width:140px}
.bn-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}
.bn-quick-grid-4{grid-template-columns:1.2fr 1.2fr .8fr .9fr}
.bn-quick-grid-5{grid-template-columns:1.1fr 1.3fr 1.3fr .9fr .9fr}
.bn-quick-grid label,.bn-reflection-label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#475569}
.bn-reflection-label textarea{width:100%;min-height:120px;resize:vertical;padding:10px 12px;border:1px solid #cbd5e1;border-radius:8px;font:inherit;line-height:1.55}
.bn-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.bn-day-block{margin-top:20px;padding-top:16px;border-top:1px solid #e2e8f0}
.bn-day-block h3{margin:0 0 10px;font-size:15px;color:var(--brand-purple-dark)}
.bn-day-list,.bn-recent-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;max-height:420px;overflow:auto}
.bn-entry-item{
  display:flex;align-items:flex-start;justify-content:space-between;gap:10px;
  border:1px solid #e2e8f0;background:#fff;border-radius:10px;padding:10px 12px;
}
.bn-entry-main{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.bn-entry-main strong{font-size:13px;color:var(--brand-purple-dark)}
.bn-entry-main span{font-size:12px;color:#475569}
.bn-entry-main small{font-size:12px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bn-entry-actions{display:flex;gap:6px;flex-shrink:0}
.bn-recent h3{margin:0 0 12px;font-size:15px;color:var(--brand-purple-dark)}
@media (max-width:1100px){
  .bn-quick-grid-4,.bn-quick-grid-5{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .bn-layout{grid-template-columns:1fr}
  .bn-quick-grid,.bn-quick-grid-4,.bn-quick-grid-5{grid-template-columns:1fr}
}


/* 版本點綴：企業版＝藍；專家版＝藍紫（僅畫面，權限由伺服器端控管） */
body.edition-expert .sidebar-user-avatar:not(.has-image) {
  background: linear-gradient(135deg, #2563eb 0%, #4b2896 100%);
  color: #fff;
}
body.edition-enterprise .sidebar-user-avatar:not(.has-image) {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
}
