:root {
  --bg: #fdfdfd;
  --panel: #ffffff;
  --ink: #222222;
  --muted: #6b7280;
  --line: #e3e3e3;
  --primary: #1f4aca;
  --primary-dark: #173a9e;
  --accent: #28a745;
  --danger: #dc3545;
  --sidebar: #f5f5f5;
  font-family: Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted, small { color: var(--muted); }
.error { color: var(--danger); min-height: 1.4em; }
.eyebrow { margin: 0 0 6px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .16em; }

/* ---------- 登入頁：照正式站（左側深藍、白卡片 500px、灰底輸入框、#1f4aca 登入鈕）。背景不放品牌圖。 ---------- */
.login-shell { min-height: 100vh; display: grid; place-items: center; gap: 24px; padding: 40px 16px 80px;
  background: linear-gradient(90deg, #000036 0 33%, transparent 33%), radial-gradient(ellipse at 70% 40%, #0d1040 0%, #060828 55%, #02041f 100%); }
.login-card { width: min(500px, 100%); padding: 60px; border-radius: 7.6px; background: #fff; box-shadow: 0 1.6px 16px 4px rgba(0,0,0,.05); color: #181c32; }
.login-title { margin: 0; color: #181c32; font-size: 21.6px; font-weight: 700; }
.tenant-line { margin: 14px 0 20px; color: #7e8299; font-size: 13px; }
.tenant-line b { color: #181c32; }
.tenant-change { margin-left: 8px; padding: 0; border: 0; background: none; color: #009ef7; font-size: 13px; font-weight: 700; }
.tenant-change:hover { color: #0095e8; text-decoration: underline; }
.login-form { display: grid; gap: 19px; }
.login-form input:not([type=checkbox]) { height: auto; padding: 16px 24px; line-height: 17px; border: 1px solid #ddd; border-radius: 0; background: #f5f8fa; color: #5e6278; font-size: 14px; font-weight: 500; }
.login-form input:not([type=checkbox])::placeholder { color: #a1a5b7; }
.login-form input:not([type=checkbox]):focus { border-color: #ddd; background: #eef3f7; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.login-form input[required]:placeholder-shown { border-color: rgba(243,23,0,.5); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.remember { display: inline-flex; align-items: center; gap: 8.8px; color: #181c32; font-size: 14px; font-weight: 400; cursor: pointer; }
.remember input { -webkit-appearance: none; appearance: none; width: 28px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 6.3px; background: #eff2f5 center / 60% 60% no-repeat; cursor: pointer; }
.remember input:focus { box-shadow: none; }
.remember input:focus-visible { box-shadow: 0 0 0 3px rgba(31,74,202,.25); }
.remember input:checked { background-color: #1f4aca; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11' fill='none'%3e%3cpath d='M11.04 1.03a.79.79 0 0 1 1.21 1.02L5.52 9.97a.79.79 0 0 1-1.18.04L.73 6.26a.79.79 0 1 1 1.14-1.1l3 3.12 6.17-7.25z' fill='%23fff'/%3e%3c/svg%3e"); }
.forgot { color: #009ef7; font-size: 14px; font-weight: 700; text-decoration: none; }
.forgot:hover { color: #0095e8; }
.login-submit { width: 100%; margin: 12px 0 0; padding: 16px 32px; line-height: 14px; border: 1px solid #1f4aca; border-radius: 0; background: #1f4aca; color: #fff; font-size: 14px; font-weight: 700; }
.login-submit:hover { border-color: #173a9e; background: #173a9e; }
/* 欄位沒填完只做成正式站的淡色外觀，不用 disabled，免得瀏覽器自動帶入密碼時按不下去。 */
.login-submit.is-empty, .login-submit.is-empty:hover { border-color: #1f4aca; background: #1f4aca; opacity: .6; }
.login-form .error { margin: 0; font-size: 13px; }
.login-form .error:empty { display: none; }
.login-form .error.info { color: #5e6278; }
.login-extra { margin-top: 20px; text-align: center; }
.login-extra .tenant-change { margin: 0; }
@media (max-width: 900px) { .login-shell { background: radial-gradient(ellipse at 50% 30%, #0d1040 0%, #060828 55%, #02041f 100%); } }
@media (max-width: 560px) { .login-card { padding: 36px 24px; } }
.stack-form { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; color: var(--ink); }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,74,202,.15); }
button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 750; }
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: #eef1f8; color: var(--primary); }
.secondary:hover { background: #dde3f3; }
.text-button { padding: 0; background: transparent; color: #aeb8cf; font-size: 12px; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 260px 1fr; }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 16px; background: var(--sidebar); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 34px; font-weight: 800; }
#main-nav { display: grid; gap: 4px; max-height: calc(100vh - 160px); overflow-y: auto; padding-right: 2px; }
.nav-item { text-align: left; background: transparent; color: #aeb8cf; border-radius: 10px; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.1); color: white; }
.nav-label { margin: 16px 10px 4px; color: #6f7896; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-subitem { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #8e98b2; text-align: left; font-size: 11px; }
.nav-subitem:hover { background: rgba(255,255,255,.08); color: white; }
.nav-subitem span, .nav-count { color: #6c77a0; font-size: 10px; }
.spec-nav { display: flex; justify-content: space-between; gap: 8px; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.1); color: #d5dbeb; font-size: 12px; }
.sidebar-actions { display: flex; gap: 8px; }
.main-content { width: min(1400px, 100%); padding: 34px 42px 60px; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.topbar h2 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.metric-grid.compact { grid-template-columns: repeat(3, 1fr); }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 8px 30px rgba(34, 54, 99, .04); }
.metric-card { padding: 22px; }
.metric-card span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { display: block; margin: 14px 0 8px; font-size: 30px; letter-spacing: -.05em; }
.metric-card small { font-size: 12px; }
.metric-card.accent strong { color: var(--accent); }
.panel { padding: 22px; margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h3 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.two-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; }
.workflow { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.workflow:last-child { border-bottom: 0; }
.workflow > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #eef1f8; color: var(--primary); font-weight: 800; }
.workflow b, .workflow small { display: block; }
.workflow small { margin-top: 4px; }
.callout { display: flex; flex-direction: column; justify-content: center; padding: 24px; border-radius: 16px; background: linear-gradient(145deg, #f3f5fb, #eef1f8); }
.callout h3 { margin: 0 0 10px; font-size: 23px; }
.callout p:last-child { margin-bottom: 0; color: #58657c; line-height: 1.7; }
.inline-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; }
.inline-form .form-actions { display: flex; align-items: end; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 10px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
td { padding: 14px 10px; border-bottom: 1px solid #f0f2f6; white-space: nowrap; }
tbody tr:hover { background: #fafbff; }
.table-action { padding: 6px 9px; border: 1px solid #dbe3ff; background: #f4f6ff; color: var(--primary); font-size: 11px; }
.table-action:hover { background: #e4eaff; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #eef1f8; color: var(--primary); font-size: 11px; font-weight: 800; }
.status.completed { background: #e5fbf3; color: #087c61; }
.status.cancelled { background: #fff0f2; color: var(--danger); }
.toast { position: fixed; right: 26px; bottom: 26px; z-index: 5; padding: 13px 16px; border-radius: 12px; background: #172033; color: white; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.spec-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(135deg, #ffffff, #f3f5fb); }
.spec-hero h3 { margin: 0 0 8px; font-size: 26px; }
.spec-hero p:last-child { max-width: 760px; margin-bottom: 0; line-height: 1.7; }
.spec-hero-badge { display: grid; place-items: center; min-width: 130px; min-height: 110px; border-radius: 18px; background: #1e1e2d; color: white; }
.spec-hero-badge strong { font-size: 34px; color: #9fb2ea; }
.spec-hero-badge span { color: #aeb8cf; font-size: 12px; }
.spec-search { max-width: 360px; }
.spec-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.spec-module-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.spec-module-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.spec-module-heading h4 { margin: 0; font-size: 16px; }
.module-count { color: var(--primary); font-size: 11px; font-weight: 800; white-space: nowrap; }
.spec-service-list { display: grid; gap: 5px; max-height: 400px; overflow: auto; }
.spec-service { border: 1px solid #edf1f7; border-radius: 8px; background: white; }
.spec-service summary { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; cursor: pointer; font-size: 12px; font-weight: 700; }
.spec-service summary small { white-space: nowrap; font-weight: 500; }
.spec-operations { display: grid; grid-template-columns: 45px 1fr; gap: 6px 10px; padding: 9px 10px 11px; border-top: 1px solid #edf1f7; color: #5f6b80; font-size: 11px; line-height: 1.6; }
.spec-operations b { color: var(--primary); }
code { color: #48617e; font-family: Monaco, Courier New, monospace; font-size: 11px; }
.mobile-fab { display: none; position: fixed; right: 18px; bottom: 18px; z-index: 10; border-radius: 999px; background: var(--primary); color: white; box-shadow: 0 8px 24px rgba(31,74,202,.35); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 9; width: 260px; min-height: 100vh; padding: 16px; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-brand { padding-bottom: 16px; }
  #main-nav { grid-template-columns: repeat(4, 1fr); }
  .sidebar-footer { margin-top: 16px; }
  .main-content { padding: 24px 16px 40px; }
  .metric-grid, .metric-grid.compact { grid-template-columns: repeat(2, 1fr); }
  .two-column { grid-template-columns: 1fr; }
  .mobile-fab { display: block; }
  .spec-module-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  #main-nav { grid-template-columns: repeat(2, 1fr); }
  .metric-grid, .metric-grid.compact { grid-template-columns: 1fr; }
  .topbar { align-items: start; flex-direction: column; }
  .inline-form { grid-template-columns: 1fr; }
}

/* ---------- 全模組頁面、方案與平台後台 ---------- */
/* 註冊新租戶：和登入卡片同一個白卡片樣式，放在登入頁背景上。 */
.pricing-shell { width: min(1100px, 100%); padding: 40px; border-radius: 7.6px; background: #fff; box-shadow: 0 1.6px 16px 4px rgba(0,0,0,.05); }
.pricing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.pricing-shell .plan-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pricing-title { margin: 0; color: #181c32; font-size: 21.6px; font-weight: 700; }
.register-card { margin-top: 24px; padding-top: 24px; border-top: 1px solid #eff2f5; }
.register-card h3 { margin: 0; color: #181c32; font-size: 16px; }
@media (max-width: 560px) { .pricing-shell { padding: 24px 16px; } }
.eyebrow.light { color: #9fd8ff; }
.small-note { font-size: 12px; margin: 0; }
.nav-group { margin: 2px 0; }
.nav-group summary { cursor: pointer; padding: 9px 10px; border-radius: 8px; color: #aeb8cf; font-size: 13px; font-weight: 700; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: rgba(255,255,255,.06); color: white; }
.nav-group[open] summary { color: white; }
.nav-group .nav-subitem { width: 100%; padding-left: 20px; font-size: 12px; }
.nav-subitem.locked { opacity: .55; }
.sidebar { overflow-y: auto; max-height: 100vh; position: sticky; top: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { padding: 8px 14px; border-radius: 999px; background: #eef1f8; color: var(--primary); font-size: 13px; }
.tab.active { background: var(--primary); color: white; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.toolbar input { width: auto; min-width: 140px; padding: 9px 11px; }
.file-button { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--primary); }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; min-height: 8px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.row-tools { white-space: nowrap; }
.editor h4 { margin: 18px 0 8px; }
.detail-table input, .detail-table select { padding: 7px 8px; min-width: 90px; }
.advanced { margin: 14px 0; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 13px; }
textarea, .json-editor { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-family: Monaco, "Courier New", monospace; font-size: 12px; }
.totals { text-align: right; margin: 8px 0; }
.danger { background: #fdecee; color: var(--danger); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.summary-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbff; }
.summary-item span { display: block; color: var(--muted); font-size: 12px; }
.summary-item b { font-size: 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.plan-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,74,202,.15); }
.plan-card h3 { margin: 0; }
.plan-card ul { padding-left: 18px; color: var(--ink); font-size: 13px; line-height: 1.7; }
.plan-card .form-actions { display: flex; gap: 8px; align-items: center; }
.plan-card .form-actions select, .plan-card .form-actions input { width: 90px; padding: 8px; }
.price { font-size: 28px; font-weight: 800; margin: 10px 0 0; letter-spacing: -.03em; }
.price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.chip { display: inline-block; margin: 3px 4px 3px 0; padding: 4px 10px; border-radius: 999px; background: #eef1f8; color: var(--primary); font-size: 12px; }
.subscription-banner { margin: -14px 0 18px; padding: 10px 14px; border-radius: 10px; background: #fff7e6; color: #8a5a00; font-size: 14px; }
.alert { padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: #f1f5ff; }
.alert.warning { background: #fff7e6; }
.alert.danger { background: #fdecee; }
.locked-panel { text-align: center; padding: 48px 22px; }
.param-row { display: flex; gap: 10px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.param-row label { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.console-output { max-height: 480px; overflow: auto; padding: 14px; border-radius: 10px; background: #0f1424; color: #d5dbeb; font-size: 12px; white-space: pre-wrap; }
.status.reviewed, .status.approved, .status.shipped, .status.confirmed, .status.active, .status.paid { background: #e8f7ee; color: #1e7a3c; }
.status.cancelled, .status.rejected, .status.suspended, .status.voided, .status.failed, .status.expired { background: #fdecee; color: var(--danger); }
.status.trial, .status.grace, .status.pending { background: #fff7e6; color: #8a5a00; }
@media (max-width: 900px) {
  .toolbar { justify-content: flex-start; }
  .plan-grid { grid-template-columns: 1fr; }
  .param-row { flex-direction: column; align-items: stretch; }
}

/* ---------- 正式站版面（erp.gogosell.com.tw）：頂部模組列＋左側子選單 ---------- */
button, input, select { border-radius: 4px; }
.app-shell { display: block; min-height: 100vh; }
.top-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; height: 40px; padding-left: 8px; background: #eeeeee; border-bottom: 1px solid #dcdcdc; }
.menu-toggle { flex: none; width: 36px; height: 32px; padding: 0; background: transparent; color: var(--primary); font-size: 18px; line-height: 1; }
.menu-toggle:hover { background: #e2e2e2; }
.module-bar { display: flex; flex: 1; justify-content: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.module-bar::-webkit-scrollbar { display: none; }
.module-item { flex: none; padding: 6px 16px; background: transparent; color: #555; font-size: 14px; font-weight: 400; white-space: nowrap; }
.module-item:hover { background: #dde3f3; color: var(--primary); text-decoration: underline; }
.module-item.active { background: #cfcfcf; color: #333; text-decoration: none; }
.user-box { position: relative; flex: none; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 20px; background: #d6d6d6; color: #555; font-size: 15px; font-weight: 700; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: #50cd89; color: #fff; font-size: 18px; font-weight: 700; }
.user-menu { position: absolute; top: 40px; right: 0; display: none; min-width: 140px; padding: 6px 0; background: #fff; border: 1px solid #dcdcdc; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.user-box:hover .user-menu, .user-box:focus-within .user-menu { display: grid; }
.user-menu .text-button { padding: 9px 16px; color: #333; font-size: 13px; font-weight: 400; text-align: left; border-radius: 0; }
.user-menu .text-button:hover { background: #f2f4fa; color: var(--primary); }
.app-body { display: flex; min-height: calc(100vh - 40px); }
.sidebar { position: sticky; top: 40px; flex: none; display: block; width: 265px; min-height: 0; max-height: calc(100vh - 40px); padding: 12px 0; overflow-y: auto; background: var(--sidebar); color: #333; border-right: 1px solid #e3e3e3; }
.app-shell.subnav-collapsed .sidebar { display: none; }
#main-nav { display: block; max-height: none; overflow: visible; padding: 0; }
.sub-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 20px; border-radius: 0; background: transparent; color: #333; font-size: 14px; font-weight: 400; text-align: left; }
.sub-item:hover { background: #e9ecf5; color: var(--primary); }
.sub-item.active { background: #e8edfb; color: var(--primary); }
.sub-icon { flex: none; width: 18px; color: #8a8f99; font-size: 16px; text-align: center; }
.sub-item:hover .sub-icon, .sub-item.active .sub-icon { color: var(--primary); }
.sub-item.locked { opacity: .55; }
.sub-badge { margin-left: auto; padding: 1px 6px; border-radius: 3px; background: #fff3cd; color: #8a5a00; font-size: 11px; }
.sub-empty { padding: 14px 20px; color: var(--muted); font-size: 13px; }
.main-content { flex: 1; width: auto; min-width: 0; padding: 18px 22px 40px; background: var(--bg); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.page-head h2 { margin: 0; color: #222; font-size: 18px; font-weight: 700; letter-spacing: 0; }
.secondary { background: #eef1f8; color: var(--primary); }
@media (max-width: 900px) {
  .app-body { display: block; }
  .sidebar { position: fixed; inset: 40px auto 0 0; z-index: 15; max-height: none; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .module-bar { justify-content: flex-start; }
  .user-box #current-user { display: none; }
}

/* ---------- 主控台（照正式站：公告｜月曆｜待辦清單）---------- */
.dash3 { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: stretch; min-height: calc(100vh - 120px); }
.dash-panel { display: flex; flex-direction: column; min-width: 0; padding: 8px 6px; background: #fff; }
.dp-head { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-bottom: 6px; }
.dp-title { color: #222; font-size: 18px; }
.dp-right { margin-left: auto; }
.dp-actions { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.dash-panel button.primary, .dash-panel button.secondary { padding: 6px 12px; font-size: 13px; font-weight: 400; }
.dash-panel button.secondary { background: #f0f0f0; color: #333; border: 1px solid #d6d6d6; }
.chip-btn { padding: 4px 12px; background: #e8edfb; color: var(--primary); font-size: 12px; font-weight: 400; }
.dp-table-wrap { flex: 1; min-height: 240px; overflow: auto; border: 1px solid #e3e3e3; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dp-table th { position: sticky; top: 0; padding: 6px; background: #f5f5f5; border-right: 1px solid #e3e3e3; border-bottom: 1px solid #e3e3e3; color: #333; font-size: 12px; font-weight: 700; letter-spacing: 0; text-align: left; }
.dp-table td { padding: 6px; border-bottom: 1px solid #f0f0f0; white-space: normal; }
.dp-empty { color: #555; text-align: center; }
.dp-check { width: 28px; text-align: center; }
.dp-check input { width: auto; }
.dp-closed td { color: #999; }
.link-btn { padding: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 400; }
.link-btn:hover { text-decoration: underline; }
.dp-pager { display: flex; align-items: center; gap: 4px; padding: 8px 4px; color: #777; font-size: 12px; }
.dp-pager button { padding: 2px 6px; background: transparent; color: #555; font-size: 12px; font-weight: 400; }
.dp-pager button:disabled { color: #ccc; cursor: default; }
.dp-pager span { margin-left: 8px; }
.cal-panel { padding: 0; }
.cal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-today { padding: 10px 18px; background: var(--primary); color: #fff; font-weight: 400; }
.cal-today:disabled { background: #a8b5e6; cursor: default; }
.cal-nav { display: flex; }
.cal-nav button { padding: 8px 18px; background: var(--primary); color: #fff; font-size: 20px; line-height: 1; border-radius: 0; }
.cal-nav button:first-child { border-radius: 4px 0 0 4px; }
.cal-nav button:last-child { border-radius: 0 4px 4px 0; }
.cal-title { flex: 1; margin: 0; color: #222; font-size: 22px; font-weight: 700; text-align: center; }
.cal-view { display: flex; }
.cal-view button { padding: 10px 18px; background: #fff; color: #333; font-weight: 400; border-radius: 0; }
.cal-view button.active { background: #d9d9d9; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid #ddd; border-left: 1px solid #ddd; }
.cal-head { padding: 14px 4px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; color: #333; font-size: 13px; text-align: center; }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-height: 106px; padding: 6px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.cal-grid.week .cal-cell { min-height: 420px; }
.cal-day { align-self: flex-end; color: #333; font-size: 12px; }
.cal-cell.other .cal-day { color: #bbb; }
.cal-cell.today { background: #fdf6d8; }
.cal-ev { overflow: hidden; padding: 1px 4px; border-radius: 3px; background: #e8edfb; color: var(--primary); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev.more { background: transparent; color: #777; }
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.35); }
.modal-card { display: grid; gap: 12px; width: min(460px, 100%); padding: 22px; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-card h3 { margin: 0 0 4px; font-size: 18px; }
.modal-card textarea { font-family: inherit; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 1100px) { .dash3 { grid-template-columns: 1fr; } }

/* ---------- 正式站原始資料（唯讀瀏覽） ---------- */
.lg-ok { color: #1b8a3a; font-weight: 700; }
.lg-bad { color: #c0392b; font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.lg-grid td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.lg-sort:hover { color: var(--primary); }
body.lg-busy, body.lg-busy * { cursor: progress !important; }

/* ---------- 自訂欄位（正式站 jk-customfield.js）：清單尾端的欄位，點一下改值 ---------- */
.cf-head { white-space: nowrap; }
.cf-pen { opacity: .45; font-size: 11px; }
.cf-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
td.cf-cell:hover, div.cf-cell:hover { background: #f3f6fd; }
.cf-cell[data-cf-disabled] { cursor: not-allowed; background: #fafafa; }
.cf-cell.cf-saved { background: #e8f5e9; }
.cf-cell.cf-failed { background: #ffebee; }
.cf-input { width: 100%; min-width: 140px; font-size: 13px; }
textarea.cf-input { min-height: 80px; }
.cf-grid { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 4px 12px; align-items: center; margin-bottom: 12px; }
.cf-grid .cf-label { color: var(--muted); font-size: 13px; }
.cf-grid .cf-cell { max-width: none; min-height: 28px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; }
.cf-panel { margin: 8px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.cf-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.cf-panel-head #cf-add { margin-left: auto; }

/* ---------- 變更密碼 ---------- */
.password-dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.password-dialog::backdrop { background: rgba(0,0,0,.35); }
.password-dialog h3 { margin: 0 0 12px; }
.password-dialog form { display: grid; gap: 10px; }
.password-dialog label { display: grid; gap: 4px; font-size: 13px; }
.password-dialog input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; }
.password-dialog .form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 稽核紀錄、登入嘗試、通知（pages/audit.js） ---------- */
.au-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.au-filters input, .au-filters select { padding: 8px 10px; }
.au-row { cursor: pointer; }
.au-row.open { background: #f4f6ff; }
.au-detail td { white-space: normal; background: #fafbff; }
.au-dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 0; font-size: 12px; }
.au-dl dt { color: var(--muted); font-weight: 700; }
.au-dl dd { margin: 0; min-width: 0; }
.au-page pre { margin: 0; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: Monaco, "Courier New", monospace; font-size: 12px; }
.au-error { color: var(--danger); }
.au-props td { white-space: normal; vertical-align: top; }
.au-local { background: #f1f1f1; color: #555; }
.au-wrap { white-space: normal; min-width: 280px; }
.au-unread td { font-weight: 700; }
.au-settings { display: grid; gap: 10px; max-width: 460px; padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfe; }
.au-settings h4 { margin: 0; }
.au-check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.au-check input { width: auto; }
.notification-bell { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 0; background: transparent; color: #555; }
.notification-bell:hover { background: #e2e2e2; color: var(--primary); }
.notification-count { position: absolute; top: 4px; right: 2px; min-width: 16px; padding: 1px 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }

/* ---------- 圖片／附件（正式站檔案 DTO） ---------- */
.thumb { display: inline-block; width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: #f5f5f5; vertical-align: middle; }
.thumb.thumb-lg { width: 120px; height: 120px; }
td .thumb { display: block; }
.file-section { display: grid; gap: 10px; margin: 8px 0 14px; }
.file-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.file-label { min-width: 40px; color: var(--muted); font-size: 13px; }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.file-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }

/* ---------- 主控台（pages/dashboard.js）：待辦狀態色點、切換鈕、公告／待辦／行事曆視窗 ---------- */
.chip-btn.active { background: var(--primary); color: #fff; }
.pd-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: middle; }
.pd-dot-open { background: #3b82f6; }
.pd-dot-closed { background: #64748b; }
.pd-dot-other { background: #cbd5e1; }
.dp-table tr[data-row] { cursor: default; user-select: none; }
.pd-window { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.pd-window.wide { width: min(900px, 100%); }
.pd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.pd-field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.pd-field.full { grid-column: 1 / -1; }
.pd-field input, .pd-field textarea { padding: 8px 10px; border-radius: 6px; font-weight: 400; }
.pd-field input[readonly], .pd-field textarea[readonly], .pd-field input:disabled { background: #f5f5f5; color: #555; }
.pd-req { margin-left: 2px; color: var(--danger); }
.pd-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px; }
.pd-code { display: flex; gap: 4px; }
.pd-code button { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.pd-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-weight: 400; }
.pd-file { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fafafa; }
.pd-file a { color: var(--primary); }
.pd-file-x { padding: 0 4px; background: transparent; color: #999; font-size: 14px; line-height: 1; }
.pd-file-add { display: inline-block; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 400; cursor: pointer; }
.pd-emp-search { margin-bottom: 6px; }
.pd-emp-list { max-height: 50vh; }
.pd-emp-list tr[data-emp] { cursor: pointer; }
.pd-emp-list tr[data-emp]:hover td { background: #eef1f8; }
.pd-ev { display: block; width: 100%; border: 0; background: cornflowerblue; color: #fff; text-align: left; cursor: pointer; }
.pd-title { word-break: break-all; }
@media (max-width: 700px) { .pd-grid { grid-template-columns: 1fr; } }
.pd-nowrap { white-space: nowrap; }

/* ---------- 人事 › 獎金計算／獎金計算設定（pages/bonus.js） ---------- */
.bonus-modal { width: min(1100px, 100%); max-height: 90vh; overflow: auto; }
.bonus-summary { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; }
.bonus-summary > span { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.bonus-summary > span b { color: var(--ink); font-size: 14px; }
.bonus-summary label input { width: 140px; padding: 8px 10px; }
.bonus-items { max-height: 55vh; overflow: auto; }
.bonus-items td, .bonus-grid td { padding: 4px 6px; }
.bonus-items input, .bonus-items select, .bonus-grid input, .bonus-grid select { padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.bonus-export-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bonus-grid { margin-top: 18px; }
.bonus-grid .panel-heading { margin-bottom: 8px; }
.bonus-grid .panel-heading h3 { font-size: 16px; }
.bonus-page .toolbar select { width: auto; min-width: 180px; padding: 9px 11px; }
.bonus-settings-page .panel-heading > div:first-child { flex: 1; }
.bonus-settings-page .toolbar button { white-space: nowrap; }
