:root {
  --navy: #12365a;
  --navy-deep: #0b2948;
  --teal: #087f83;
  --teal-bright: #08a6ac;
  --cyan: #e9f8f8;
  --ink: #1a344c;
  --muted: #6f8293;
  --line: #dce6ec;
  --panel: #ffffff;
  --page: #f3f7fa;
  --warn: #dd8617;
  --danger: #d94a55;
  --success: #169b67;
  --shadow: 0 18px 50px rgba(23, 64, 92, .10);
}
* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--page); font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.demo-ribbon { min-height: 38px; padding: 8px 24px; display: flex; justify-content: center; align-items: center; gap: 12px; color: #ebffff; background: linear-gradient(90deg, #075d66, #087f83 58%, #0a6e8f); font-size: 12px; letter-spacing: .02em; }
.demo-ribbon strong { padding: 3px 8px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; font-size: 10px; letter-spacing: .08em; }
.shell { min-height: calc(100vh - 38px); display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: calc(100vh - 38px); z-index: 20; padding: 22px 16px 18px; display: flex; flex-direction: column; color: #d9ecf4; background: linear-gradient(180deg, var(--navy-deep), #123e62); box-shadow: 8px 0 28px rgba(11, 41, 72, .09); }
.brand { padding: 2px 8px 28px; display: flex; align-items: center; gap: 11px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.brand span { display: grid; gap: 1px; }
.brand strong { color: #fff; font-size: 18px; letter-spacing: .08em; }
.brand small { color: #8fcbd7; font-size: 9px; letter-spacing: .08em; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { width: 100%; min-height: 43px; padding: 0 13px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 10px; color: #c5d9e5; background: transparent; cursor: pointer; text-align: left; font-size: 12px; transition: .18s ease; }
.nav-item span { width: 22px; color: #78b8c8; font-size: 17px; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, #078b91, #0c9bae); box-shadow: 0 10px 22px rgba(0, 170, 176, .22); }
.nav-item.active span { color: #fff; }
.sidebar-note { margin-top: auto; padding: 14px; border: 1px solid rgba(154, 223, 230, .18); border-radius: 12px; background: rgba(255,255,255,.05); }
.sidebar-note span { color: #79d5db; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.sidebar-note p { margin: 6px 0 0; color: #b7ccd8; font-size: 10px; line-height: 1.6; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 76px; padding: 13px 28px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); background: #fff; cursor: pointer; }
.global-search { position: relative; width: min(470px, 48vw); }
.global-search label { display: block; margin-bottom: 4px; color: #648090; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.global-search input { width: 100%; height: 38px; padding: 0 14px 0 35px; border: 1px solid #d6e2e8; border-radius: 9px; outline: none; color: var(--ink); background: #f8fbfc; font-size: 11px; }
.global-search::after { content: "⌕"; position: absolute; left: 12px; bottom: 8px; color: var(--teal); font-size: 18px; }
.global-search input:focus { border-color: #56aeb2; box-shadow: 0 0 0 4px rgba(8,127,131,.09); background: #fff; }
.suggestions { position: absolute; left: 0; right: 0; top: 58px; z-index: 40; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.suggestion { width: 100%; padding: 11px 13px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; border: 0; border-bottom: 1px solid #edf2f5; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover { background: #f1f9f9; }
.suggestion strong { font-size: 11px; }
.suggestion small { color: var(--muted); font-size: 9px; }
.suggestion em { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--teal); font-size: 9px; font-style: normal; }
.github-link { margin-left: auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: #416178; background: #fff; text-decoration: none; font-size: 10px; font-weight: 700; }
.github-link:hover { color: var(--teal); border-color: #8ac4c7; }
.demo-user { padding-left: 16px; border-left: 1px solid var(--line); display: grid; gap: 2px; }
.demo-user span { color: var(--teal); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.demo-user strong { color: var(--navy); font-size: 11px; }

#app { padding: 28px; }
.page-head { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.page-head h1 { margin: 0; color: var(--navy); font-size: clamp(23px, 2.3vw, 34px); letter-spacing: -.02em; }
.page-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.demo-action { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; color: #fff; background: var(--teal); cursor: pointer; font-size: 10px; font-weight: 750; box-shadow: 0 8px 16px rgba(8,127,131,.18); }
.demo-action.secondary { border: 1px solid var(--line); color: #47687b; background: #fff; box-shadow: none; }
.demo-action:disabled { opacity: .65; cursor: not-allowed; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { min-height: 124px; padding: 18px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 8px 28px rgba(31, 73, 102, .05); }
.metric::after { content: ""; position: absolute; right: -18px; bottom: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--metric-tint, #e8f6f6); }
.metric small { color: #77909f; font-size: 9px; font-weight: 700; }
.metric strong { margin-top: 12px; display: block; color: var(--metric-color, var(--navy)); font-size: 30px; line-height: 1; }
.metric p { margin: 10px 0 0; color: var(--muted); font-size: 9px; }
.metric.teal { --metric-color: var(--teal); --metric-tint: #dff5f3; }
.metric.orange { --metric-color: var(--warn); --metric-tint: #fff0dd; }
.metric.red { --metric-color: var(--danger); --metric-tint: #fbe5e7; }
.metric.green { --metric-color: var(--success); --metric-tint: #e0f5eb; }

.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 28px rgba(31,73,102,.05); }
.panel-head { min-height: 59px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e9eff2; }
.panel-head h2 { margin: 0; color: var(--navy); font-size: 13px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.text-link { border: 0; color: var(--teal); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.quick-search-card { padding: 18px; }
.quick-search-card label { display: block; margin-bottom: 6px; color: #667d8c; font-size: 9px; font-weight: 700; }
.quick-search-card input { width: 100%; height: 41px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 11px; }
.quick-search-card .hint { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.quick-result { margin-top: 13px; padding: 13px; border-radius: 10px; background: #eef8f7; }
.quick-result strong { display: block; color: var(--navy); font-size: 12px; }
.quick-result span { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; }
.quick-result em { margin-top: 8px; display: inline-flex; padding: 3px 7px; border-radius: 999px; color: #0a8558; background: #d8f2e6; font-size: 8px; font-style: normal; font-weight: 800; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 14px; color: #78909e; background: #f8fafb; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #edf2f4; color: #496273; font-size: 10px; white-space: nowrap; }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: #f4fafa; }
td strong { color: var(--navy); font-size: 10px; }
td small { margin-top: 2px; display: block; color: #8a9aa5; font-size: 8px; }
.status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.status::before { content: ""; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.status.ok { color: #128958; background: #e2f6ec; }
.status.due { color: #c77813; background: #fff0d9; }
.status.overdue { color: #c53d49; background: #fce5e7; }
.status.progress { color: #167ba0; background: #e3f2f8; }
.status.neutral { color: #738391; background: #edf1f4; }

.list-grid { display: grid; gap: 14px; }
.customer-card { padding: 17px; display: grid; grid-template-columns: minmax(180px, 1fr) 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; transition: .18s; }
.customer-card:hover { border-color: #9ecacc; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(22,71,91,.07); }
.customer-card h3 { margin: 0; color: var(--navy); font-size: 13px; }
.customer-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.contact-line { display: grid; gap: 5px; color: #4d6879; font-size: 9px; }
.contact-line a { color: var(--teal); text-decoration: none; }
.count-pill { padding: 6px 10px; border-radius: 999px; color: var(--teal); background: #e5f5f4; font-size: 9px; font-weight: 800; }
.filter-row { margin-bottom: 14px; padding: 12px; display: flex; flex-wrap: wrap; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.filter-row input, .filter-row select { min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: #4e6676; background: #fff; font-size: 9px; }
.filter-row input { min-width: min(280px, 100%); }

.engineer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.engineer-card { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.engineer-head { display: flex; align-items: center; gap: 11px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--teal), #2278a2); font-size: 12px; font-weight: 800; }
.engineer-head h3 { margin: 0; color: var(--navy); font-size: 12px; }
.engineer-head p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.engineer-numbers { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.engineer-numbers div { padding: 10px 6px; border-radius: 9px; background: #f5f8fa; text-align: center; }
.engineer-numbers strong { display: block; color: var(--navy); font-size: 16px; }
.engineer-numbers span { color: var(--muted); font-size: 7px; }
.progress-bar { margin-top: 15px; height: 7px; overflow: hidden; border-radius: 999px; background: #e7edef; }
.progress-bar span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #29b99c); }
.completion { margin-top: 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }

.timeline { margin-top: 17px; padding-left: 14px; border-left: 2px solid #dcebed; display: grid; gap: 16px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -20px; top: 3px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 2px #b8dcde; }
.timeline-item time { color: var(--teal); font-size: 8px; font-weight: 800; }
.timeline-item strong { margin-top: 3px; display: block; color: var(--navy); font-size: 10px; }
.timeline-item p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,31,51,.56); backdrop-filter: blur(3px); }
.modal-card { position: relative; z-index: 1; width: min(680px, 100%); max-height: 88vh; overflow-y: auto; padding: 25px; border-radius: 17px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 35px; height: 35px; border: 0; border-radius: 9px; color: #667c8a; background: #edf2f4; cursor: pointer; font-size: 20px; }
.modal-card h2 { margin: 7px 45px 0 0; color: var(--navy); font-size: 24px; }
.detail-code { margin-top: 4px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.detail-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.detail-grid small { display: block; color: var(--muted); font-size: 8px; }
.detail-grid strong { margin-top: 5px; display: block; color: #36556a; font-size: 10px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; padding: 11px 15px; border-radius: 10px; color: #fff; background: #163b55; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; font-size: 10px; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1020px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .engineer-grid { grid-template-columns: 1fr 1fr; }
  .demo-user { display: none; }
}

@media (max-width: 760px) {
  .demo-ribbon { padding: 8px 12px; align-items: flex-start; gap: 7px; font-size: 9px; line-height: 1.45; }
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: 250px; transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .topbar { min-height: 68px; padding: 10px 14px; gap: 10px; }
  .menu-button { display: grid; place-items: center; flex: 0 0 auto; }
  .global-search { width: 100%; }
  .global-search label { display: none; }
  .global-search input { height: 40px; padding-left: 32px; }
  .global-search::after { bottom: 8px; }
  .suggestions { top: 46px; }
  .github-link { display: none; }
  #app { padding: 19px 14px 76px; }
  .page-head { align-items: flex-start; }
  .page-head .demo-action { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 112px; padding: 15px; }
  .metric strong { font-size: 25px; }
  .customer-card { grid-template-columns: 1fr auto; }
  .customer-card .contact-line { grid-column: 1 / -1; }
  .engineer-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 102px; }
}
