:root {
  --c-navy: #0F172A; --c-slate-700: #334155; --c-slate-600: #475569;
  --c-slate-500: #64748B; --c-slate-400: #94A3B8; --c-slate-300: #CBD5E1;
  --c-border: #E2E8F0; --c-bg-page: #F8FAFC; --c-bg-soft: #F1F5F9; --c-white: #FFF;
  --c-accent: #3B82F6; --c-accent-hover: #2563EB;
  --c-accent-soft: #EFF6FF; --c-accent-border: #BFDBFE;
  --c-danger: #EF4444; --c-danger-dark: #DC2626;
  --c-success: #10B981; --c-warning: #F59E0B;
  --radius-input: 8px; --radius-card: 16px; --radius-pill: 999px;
  --shadow-card: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-pop: 0 10px 22px rgba(15, 23, 42, .08);
  --font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--c-bg-page); color: var(--c-navy);
  font-family: var(--font-family); font-size: 14px; -webkit-font-smoothing: antialiased; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button { font: inherit; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.rail { width: 84px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; }
.rail__logo { width: 40px; height: 40px; border-radius: 10px; background: var(--c-accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.rail__item { width: 68px; padding: 10px 0 8px; border-radius: 12px; border: 0; background: none;
  color: var(--c-slate-500); display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.rail__item svg { width: 22px; height: 22px; }
.rail__item:hover { background: var(--c-bg-soft); }
.rail__item.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover); font-weight: 600; }

.flyout { width: 252px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column; }
.flyout__head { padding: 20px 18px 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.flyout__head::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--c-accent); }
.flyout__list { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.folder { margin-top: 6px; }
.folder__row { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none;
  padding: 8px 6px; font-size: 12px; font-weight: 700; color: var(--c-slate-500); cursor: pointer; border-radius: 8px; }
.folder__row:hover { background: var(--c-bg-soft); }
.folder__row svg { width: 12px; height: 12px; transition: transform .15s ease; }
.folder.is-collapsed .folder__row svg { transform: rotate(-90deg); }
.folder.is-collapsed .folder__items { display: none; }
.count-pill { margin-left: auto; background: var(--c-bg-soft); color: var(--c-slate-500);
  font-size: 11px; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.folder__items { margin-left: 15px; padding-left: 8px; border-left: 1px solid var(--c-border); }
.nav-item { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0;
  background: none; text-align: left; padding: 8px 10px; margin: 2px 0; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--c-slate-600); cursor: pointer; transition: background .15s ease; }
.nav-item:hover { background: var(--c-bg-soft); }
.nav-item.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover);
  box-shadow: inset 2px 0 0 var(--c-accent); }
.nav-item code { font-family: inherit; font-size: 10.5px; color: var(--c-slate-400); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.crumb { color: var(--c-slate-500); font-size: 13px; }
.crumb b { color: var(--c-navy); font-weight: 600; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.wh-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--c-slate-600); background: var(--c-bg-soft); padding: 4px 12px; border-radius: 999px; }
.wh-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-success); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent-hover);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.icon-btn { border: 0; background: none; color: var(--c-slate-500); width: 32px; height: 32px;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--c-bg-soft); }
.menu-toggle { display: none; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.page { max-width: 1152px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  animation: fadeUp .2s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.page-head__icon { background: var(--c-accent); color: #fff; padding: 8px; border-radius: 8px; display: flex; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.page-head__code { color: var(--c-slate-500); font-size: 13px; }

/* ---------- card ---------- */
.card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 24px; }
.card__title { font-size: 16px; font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.card__title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
.card__title .sub { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--c-slate-400); }

/* ---------- query ---------- */
.query-grid { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.query-field { display: flex; align-items: center; gap: 10px; }
.query-field__label { width: 96px; flex-shrink: 0; text-align: right; color: var(--c-slate-600); font-weight: 500; }
.query-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 22px -24px -24px;
  padding: 14px 24px; background: var(--c-bg-page); border-top: 1px solid var(--c-border); border-radius: 0 0 15px 15px; }

.input, .select { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--c-border);
  border-radius: var(--radius-input); font: inherit; color: var(--c-navy); outline: none; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder { color: var(--c-slate-400); }
.input:focus, .select:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.btn { height: 38px; padding: 0 18px; border-radius: var(--radius-input); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn--primary { background: var(--c-accent); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.btn--primary:hover { background: var(--c-accent-hover); }
.btn--secondary { background: #fff; color: var(--c-slate-600); border-color: var(--c-border); }
.btn--secondary:hover { background: var(--c-bg-soft); }
.btn--ghost { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.btn--ghost:hover { background: #DBEAFE; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.kpi { padding: 20px 22px; }
.kpi__label { color: var(--c-slate-500); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi__label svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.kpi__value { font-size: 28px; font-weight: 700; margin: 8px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi__value small { font-size: 14px; font-weight: 500; color: var(--c-slate-500); margin-left: 4px; }
.kpi__delta { font-size: 12px; color: var(--c-slate-500); }
.up { color: #059669; font-weight: 600; } .down { color: var(--c-danger-dark); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 14px; border-radius: 4px 4px 0 0; transition: height .4s ease; }
.bar--in { background: var(--c-accent); } .bar--out { background: var(--c-slate-300); }
.bars__x { font-size: 12px; color: var(--c-slate-500); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--c-slate-500); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.meter { margin-bottom: 14px; }
.meter__top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter__top span:last-child { color: var(--c-slate-500); font-variant-numeric: tabular-nums; }
.meter__track { height: 8px; border-radius: 999px; background: var(--c-bg-soft); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 999px; background: var(--c-accent); }
.meter__fill.is-warn { background: var(--c-warning); } .meter__fill.is-danger { background: var(--c-danger); }

/* ---------- table ---------- */
.table-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.table-bar__count { color: var(--c-slate-500); }
.table-bar__count b { color: var(--c-accent-hover); }
.table-bar__right { margin-left: auto; display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.table th { text-align: left; color: var(--c-slate-500); font-size: 13px; font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--c-border); background: #fff; white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--c-bg-soft); white-space: nowrap; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--c-accent-soft); }
.table tbody tr.clickable { cursor: pointer; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.muted { color: var(--c-slate-400); font-size: 12px; }
.link { color: var(--c-accent-hover); font-weight: 500; cursor: pointer; background: none; border: 0; padding: 0; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 16px; }
.pager button { min-width: 30px; height: 30px; border: 1px solid var(--c-border); background: #fff; border-radius: 8px;
  color: var(--c-slate-600); cursor: pointer; font-size: 13px; }
.pager button.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover); border-color: var(--c-accent-border); font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; display: inline-block; line-height: 20px; }
.tag--success { background: #ECFDF5; color: #059669; }
.tag--warning { background: #FFFBEB; color: #B45309; }
.tag--danger  { background: #FEF2F2; color: #DC2626; }
.tag--info    { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.tag--muted   { background: #F1F5F9; color: #64748B; }

.empty { text-align: center; padding: 40px 0; color: var(--c-slate-400); font-weight: 500; }
.empty__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--c-bg-soft); color: var(--c-slate-300);
  display: grid; place-items: center; margin: 0 auto 10px; }
.empty__icon svg { width: 26px; height: 26px; }

/* ---------- step bar / KV ---------- */
.steps { display: flex; align-items: flex-start; justify-content: center; gap: 0; padding: 4px 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 120px; font-size: 13px; color: var(--c-slate-500); }
.step__dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--c-bg-soft); color: var(--c-slate-400); }
.step.is-active .step__dot { background: var(--c-accent); color: #fff; box-shadow: 0 0 0 4px var(--c-accent-soft); }
.step.is-active { color: var(--c-navy); font-weight: 600; }
.step.is-done .step__dot { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.step-line { flex: 1; max-width: 120px; margin-top: 20px;
  background: repeating-linear-gradient(90deg, var(--c-accent-border) 0 6px, transparent 6px 12px); height: 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 24px; }
.kv__row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--c-bg-soft); }
.kv__k { width: 110px; flex-shrink: 0; text-align: right; color: var(--c-slate-500); font-size: 13px; }
.kv__v { font-weight: 500; }

.form-lines { width: 100%; border-collapse: collapse; }
.form-lines th { text-align: left; font-size: 13px; color: var(--c-slate-500); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--c-border); }
.form-lines td { padding: 6px; }

/* ---------- dialog / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.dialog { background: #fff; border-radius: 16px; width: min(640px, 100%); max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: fadeUp .2s ease; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--c-border); }
.dialog__body { padding: 20px 24px; overflow-y: auto; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: var(--c-bg-page);
  border-top: 1px solid var(--c-border); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--c-navy); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-pop); z-index: 60; animation: fadeUp .2s ease; }
.toast[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .flyout { position: fixed; left: 84px; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow-pop);
    transform: translateX(-120%); transition: transform .2s ease; }
  .app.is-menu-open .flyout { transform: none; }
  .menu-toggle { display: grid; }
}
@media (max-width: 640px) {
  .rail { position: fixed; bottom: 0; left: 0; right: 0; width: auto; height: 64px; flex-direction: row;
    justify-content: space-around; padding: 4px; border-right: 0; border-top: 1px solid var(--c-border); z-index: 45; }
  .rail__logo { display: none; }
  .rail__item { width: auto; flex: 1; padding: 6px 0; font-size: 11px; }
  .flyout { left: 0; bottom: 64px; }
  .content { padding: 16px 16px 88px; }
  .topbar { padding: 0 16px; }
  .wh-pill { display: none; }
  .query-field { flex-direction: column; align-items: stretch; gap: 6px; }
  .query-field__label { width: auto; text-align: left; }
  .kv__k { width: 90px; }
  .steps .step { width: 76px; font-size: 12px; }
}

/* =====================================================================
   客戶商機開發系統 Demo — 追加樣式（登入 / 轉場 / 首頁 / 共用元件）
   ===================================================================== */
.muted-text { color: var(--c-slate-500); font-size: 13px; }
.sub-title { font-size: 14px; font-weight: 600; margin: 20px 0 8px; color: var(--c-slate-700); }
.pitch { margin: 0; padding: 12px 14px; background: var(--c-bg-page); border: 1px solid var(--c-border); border-radius: 8px; line-height: 1.7; color: var(--c-slate-700); }
.ellipsis { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.is-danger-text { color: var(--c-danger-dark) !important; }
.form-err { color: var(--c-danger-dark); font-size: 13px; margin: 4px 0 0; }
.pager__gap { color: var(--c-slate-400); padding: 0 4px; }
.card__title .link.sub { margin-left: auto; font-size: 13px; }
.range { display: flex; align-items: center; gap: 6px; width: 100%; }
.range span { color: var(--c-slate-400); }
.range .input { min-width: 0; }
.textarea { height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack .query-field__label { width: 88px; }
.query-actions--inline { margin: 4px 0 0; padding: 0; background: none; border: 0; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton i { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--c-bg-soft) 0%, #E9EEF5 50%, var(--c-bg-soft) 100%); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
.skeleton i:first-child { width: 30%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.nav-item:disabled { opacity: .45; cursor: not-allowed; }
.nav-item:disabled:hover { background: none; }
.flyout__note { font-size: 12px; color: var(--c-slate-400); padding: 12px 10px; }
.dialog--wide { width: min(860px, 100%); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand__mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--c-accent); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.brand__mark--lg { width: 56px; height: 56px; font-size: 15px; border-radius: 14px; }
.brand__text { font-size: 17px; font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.brand__text small { font-size: 11px; font-weight: 600; color: var(--c-slate-400); letter-spacing: .2em; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.login__body { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; }
.login__hero { position: relative; overflow: hidden; background: var(--c-navy); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login__hero-deco { position: absolute; inset: 0; pointer-events: none; }
.deco-ring { position: absolute; border: 1px solid rgba(148,163,184,.18); border-radius: 50%; }
.deco-ring--1 { width: 520px; height: 520px; right: -180px; top: -160px; }
.deco-ring--2 { width: 340px; height: 340px; right: -60px; top: -40px; }
.deco-ring--3 { width: 180px; height: 180px; left: -60px; bottom: -40px; }
.deco-chart { position: absolute; right: 48px; bottom: 110px; width: 300px; color: rgba(59,130,246,.55); }
.login__hero-body { position: relative; margin-top: auto; margin-bottom: 40px; max-width: 460px; }
.hero-slide { min-height: 170px; }
.hero-slide.is-in { animation: fadeUp .5s ease; }
.login__hero-title { font-size: 36px; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; margin: 0 0 16px; }
.login__hero-desc { color: var(--c-slate-300); line-height: 1.8; margin: 0; }
.login__hero-tags { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.hero-tag { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(148,163,184,.35); color: var(--c-slate-300); }
.hero-dots { display: flex; gap: 8px; margin-top: 28px; }
.hero-dots__dot { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(148,163,184,.4); cursor: pointer; padding: 0; transition: width .2s ease, background .2s ease; }
.hero-dots__dot.is-active { width: 24px; background: var(--c-accent); }
.login__hero-foot { position: relative; font-size: 12px; letter-spacing: .2em; color: var(--c-slate-400); text-transform: uppercase; }
.login__panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px 24px; background: var(--c-bg-page); }
.login__form { width: min(380px, 100%); background: #fff; border: 1px solid var(--c-border); border-radius: 16px; box-shadow: var(--shadow-card); padding: 36px 32px; margin: auto 0; }
.login__title { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.02em; }
.login__sub { color: var(--c-slate-500); margin: 0 0 24px; font-size: 13px; }
.login__field { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 12px; border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.login__field:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.login__field-icon { color: var(--c-slate-400); display: flex; }
.login__field-icon svg { width: 18px; height: 18px; }
.login__input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 15px; color: var(--c-navy); background: none; }
.login__input::placeholder { color: var(--c-slate-400); }
.login__field-btn { border: 0; background: none; color: var(--c-slate-400); cursor: pointer; display: flex; padding: 4px; border-radius: 6px; }
.login__field-btn:hover { background: var(--c-bg-soft); }
.login__field-btn svg { width: 16px; height: 16px; }
.login__err { color: var(--c-danger-dark); font-size: 13px; margin: -4px 0 12px; }
.login__submit { width: 100%; height: 44px; justify-content: center; font-size: 15px; letter-spacing: .3em; }
.login__demo { width: 100%; justify-content: center; margin-top: 10px; }
.login__hint { font-size: 12px; color: var(--c-slate-400); text-align: center; margin: 16px 0 0; line-height: 1.6; }
.login__panel-foot { font-size: 12px; color: var(--c-slate-400); margin-top: 24px; }

/* ---------- boot overlay ---------- */
.boot-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(248,250,252,.92); backdrop-filter: blur(4px); display: grid; place-items: center; animation: fade .2s ease; }
.boot-overlay.is-out { opacity: 0; transition: opacity .3s ease; }
.boot-overlay__card { width: 280px; background: #fff; border: 1px solid var(--c-border); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 32px 28px; text-align: center; animation: fadeUp .3s ease; }
.boot-overlay__mark { position: relative; width: 84px; height: 84px; margin: 0 auto 20px; display: grid; place-items: center; }
.boot-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--c-accent-soft); border-top-color: var(--c-accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-overlay__bar { height: 4px; border-radius: 999px; background: var(--c-bg-soft); overflow: hidden; }
.boot-overlay__bar span { display: block; height: 100%; width: 0; background: var(--c-accent); animation: boot 1.5s ease forwards; }
@keyframes boot { to { width: 100%; } }
.boot-overlay__text { margin-top: 14px; font-size: 13px; color: var(--c-slate-500); animation: fadeUp .3s ease; }

/* ---------- shell additions ---------- */
.rail__logo { font-size: 12px; }
.marquee { height: 32px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 24px; background: var(--c-accent-soft); color: var(--c-accent-hover); font-size: 13px; font-weight: 500; overflow: hidden; border-bottom: 1px solid var(--c-accent-border); }
.marquee svg { width: 16px; height: 16px; }
.marquee__track { flex: 1; overflow: hidden; white-space: nowrap; }
.marquee__track span { display: inline-block; padding-left: 100%; animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track span { animation: none; padding-left: 0; } }
.topbar__right { position: relative; }
.agent-pill { font-size: 12px; font-weight: 600; color: #B45309; background: #FFFBEB; padding: 4px 12px; border-radius: 999px; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; color: var(--c-slate-500); transition: background .15s ease; }
.user-btn:hover { background: var(--c-bg-soft); }
.user-btn svg { width: 14px; height: 14px; }
.user-btn__text { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.user-btn__text b { color: var(--c-navy); font-size: 13px; }
.user-btn__text small { font-size: 11px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; animation: fadeUp .15s ease; }
.user-menu[hidden] { display: none; }
.user-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--c-slate-700); cursor: pointer; }
.user-menu button:hover { background: var(--c-bg-soft); }
.user-menu button svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.user-menu button.is-danger { color: var(--c-danger-dark); }
.user-menu hr { border: 0; border-top: 1px solid var(--c-border); margin: 4px 0; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 10px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.choice:hover { background: var(--c-bg-page); }
.choice:has(input:checked) { border-color: var(--c-accent-border); background: var(--c-accent-soft); }
.choice input { accent-color: var(--c-accent); }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--c-slate-400); font-size: 12px; }

/* ---------- home ---------- */
.kpi--link { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.kpi--link:hover { border-color: var(--c-accent-border); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.home-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav b { min-width: 104px; text-align: center; font-size: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__w { text-align: center; font-size: 12px; color: var(--c-slate-400); padding: 4px 0; font-weight: 600; }
.cal__d { aspect-ratio: 1.25; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; color: var(--c-navy); transition: background .15s ease; }
.cal__d:hover { background: var(--c-bg-soft); }
.cal__d.is-blank { cursor: default; }
.cal__d.is-today .cal__n { background: var(--c-accent); color: #fff; }
.cal__d.is-sel { border-color: var(--c-accent-border); background: var(--c-accent-soft); }
.cal__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.cal__dots { display: flex; gap: 3px; height: 6px; }
.cal__dots i { width: 6px; height: 6px; border-radius: 50%; }
.ev-約訪 { background: var(--c-accent); } .ev-待辦 { background: var(--c-warning); } .ev-會議 { background: var(--c-slate-400); }
.ev-bd, .dot-bd { background: #fff; box-shadow: inset 0 0 0 1.5px #EC4899; }
.legend i.dot-bd { border-radius: 50%; }
.timeline { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.tl { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--c-bg-soft); }
.tl time { font-size: 12px; color: var(--c-slate-500); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl b { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tl b svg { width: 16px; height: 16px; color: #EC4899; }
.tl p { margin: 4px 0 0; font-size: 13px; color: var(--c-slate-600); }
.timeline .empty { padding: 32px 0; }
.timeline .empty svg { width: 28px; height: 28px; color: var(--c-slate-300); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--c-bg-soft); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed li > svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.feed li span:not(.tag) { flex: 1; min-width: 0; }
.feed time { font-size: 12px; color: var(--c-slate-400); white-space: nowrap; }
.fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fav { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--c-border); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: var(--c-slate-700); text-align: left; transition: background .15s ease, border-color .15s ease; }
.fav:hover { background: var(--c-accent-soft); border-color: var(--c-accent-border); color: var(--c-accent-hover); }
.fav svg { width: 18px; height: 18px; color: var(--c-accent); }
.func-list { display: flex; flex-direction: column; }
.func { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--c-bg-soft); }
.func > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.func svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.func code { font-family: inherit; font-size: 11px; color: var(--c-slate-400); }
.func__ops { display: flex; align-items: center; gap: 4px; }
.func__ops .icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- search / segment / tabs ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--c-bg-soft); border-radius: 10px; margin-bottom: 12px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--c-slate-500); cursor: pointer; transition: background .15s ease; }
.seg input:checked + span { background: #fff; color: var(--c-accent-hover); box-shadow: var(--shadow-card); }
.seg input:focus-visible + span { outline: 2px solid var(--c-accent); }
.search-bar { display: flex; align-items: center; gap: 10px; }
.search-bar > svg { color: var(--c-slate-400); }
.search-bar .input { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin: -4px 0 16px; overflow-x: auto; }
.tabs__btn { border: 0; background: none; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 500; color: var(--c-slate-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs__btn:hover { color: var(--c-navy); }
.tabs__btn.is-active { color: var(--c-accent-hover); border-bottom-color: var(--c-accent); font-weight: 600; }

@media (max-width: 1100px) { .home-grid, .home-grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .login__body { grid-template-columns: 1fr; }
  .login__hero { padding: 28px 24px; min-height: 240px; }
  .login__hero-body { margin: 24px 0 0; }
  .hero-slide { min-height: 0; }
  .login__hero-title { font-size: 26px; }
  .deco-chart, .login__hero-foot { display: none; }
}
@media (max-width: 640px) {
  .login__hero { display: none; }
  .login__form { padding: 28px 20px; }
  .user-btn__text { display: none; }
  .marquee { padding: 0 16px; }
  .tl { grid-template-columns: 72px 1fr; }
  .form-stack .query-field { flex-direction: column; align-items: stretch; }
  .dialog__body { padding: 16px; }
}

.home-grid > *, .two-col > * { min-width: 0; }
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 22px; }
  .kpi__label { font-size: 12px; }
  .cal-nav b { min-width: 88px; font-size: 13px; }
  .cal__d { aspect-ratio: 1; }
  .fav-grid { grid-template-columns: 1fr; }
}
