:root {
  --ink: #202124;
  --muted: #73777c;
  --line: #e3e5e7;
  --canvas: #f5f6f7;
  --paper: #ffffff;
  --forest: #171719;
  --mint: #ffe5e7;
  --brand-red: #e30012;
  --brand-red-dark: #b6000e;
  --brand-black: #111214;
  --green: #198754;
  --amber: #dc8e21;
  --red: #e30012;
  --blue: #4b657d;
  --shadow: 0 12px 32px rgba(22, 24, 27, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "DM Sans", "Noto Sans TC", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; padding: 22px 18px 28px; color: #f4f4f4; background: var(--brand-black); display: flex; flex-direction: column; z-index: 10; }
.brand { display: grid; gap: 11px; margin-bottom: 24px; padding: 13px 13px 12px; border-radius: 12px; background: white; }
.brand-logo-box { width: 158px; height: 34px; overflow: hidden; display: flex; align-items: center; }
.brand-logo-box img { display: block; width: 158px; height: auto; }
.brand-product strong, .brand-product span { display: block; }.brand-product strong { color: #202124; font-size: 12px; letter-spacing: .08em; }.brand-product span { margin-top: 3px; color: #828282; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; }
nav { display: grid; gap: 7px; }
.nav-item { border: 0; padding: 12px 13px; border-radius: 10px; background: transparent; color: #b8cdc6; display: flex; align-items: center; gap: 12px; text-align: left; transition: .2s; }
.nav-item span { width: 20px; font-size: 17px; }.nav-item b { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 20px; background: #d76655; color: white; text-align: center; font-size: 11px; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: white; }.nav-item.active { background: linear-gradient(90deg,rgba(227,0,18,.24),rgba(255,255,255,.06)); box-shadow: inset 3px 0 var(--brand-red); }
.sidebar-foot { margin-top: auto; }.engine-status { display: flex; gap: 10px; padding: 13px 10px; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); }
.engine-status i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #64e0ad; box-shadow: 0 0 0 4px rgba(100,224,173,.12); }.engine-status strong, .engine-status span { display: block; }.engine-status strong { font-size: 12px; }.engine-status span { margin-top: 3px; color: #91aaa2; font-size: 10px; }
.text-button { border: 0; background: transparent; color: #91aaa2; padding: 16px 10px 0; font-size: 11px; }
main { grid-column: 2; min-width: 0; padding: 0 32px 42px; }
.topbar { min-height: 106px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.eyebrow, .section-kicker { margin: 0 0 5px; color: #79918a; font-size: 10px; font-weight: 700; letter-spacing: .18em; }.topbar h1 { margin: 0; font-size: 25px; line-height: 1.2; }
.top-actions { display: flex; align-items: center; gap: 10px; }.search { width: 260px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }.search span { color: #82958f; font-size: 20px; }.search input { width: 100%; border: 0; outline: 0; color: var(--ink); }
.role-switch { display:flex;align-items:center;gap:7px;padding:5px 6px 5px 10px;border:1px solid var(--line);border-radius:10px;background:white; }.role-switch span { color:var(--muted);font-size:9px; }.role-switch select { max-width:105px;border:0;outline:0;color:var(--ink);background:#f1f6f4;border-radius:6px;padding:5px;font-size:10px; }
.primary-button, .secondary-button, .icon-button, .ghost-light { border: 0; border-radius: 9px; font-weight: 600; transition: .2s; }.primary-button { height: 40px; padding: 0 16px; color: white; background: var(--brand-red); box-shadow: 0 5px 14px rgba(227,0,18,.16); }.primary-button:hover { transform: translateY(-1px); background: var(--brand-red-dark); }.secondary-button { padding: 9px 14px; border: 1px solid var(--line); color: var(--ink); background: white; }.secondary-button:hover,.icon-button:hover { border-color:#f0a3a9;color:var(--brand-red); }.secondary-button.small { padding: 7px 11px; font-size: 12px; }.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); color: var(--ink); background: white; font-size: 18px; }
button:disabled,input:disabled,select:disabled { cursor:not-allowed;opacity:.38; }
.view { display: none; animation: enter .28s ease; }.view.active { display: block; }@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.hero-strip { min-height: 150px; padding: 30px 34px; border-radius: 16px; color: white; background: linear-gradient(112deg, #111214 0%, #2c1719 56%, #9f0713 100%); display: flex; align-items: flex-end; justify-content: space-between; box-shadow: var(--shadow); position: relative; overflow: hidden; }.hero-strip::after { content: ""; position: absolute; right: 9%; top: -95px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 40px rgba(255,255,255,.03), 0 0 0 80px rgba(255,255,255,.025); }
.live-pill { display: inline-block; padding: 3px 7px; color: var(--brand-red); background: white; border-radius: 20px; font-size: 9px; font-weight: 800; letter-spacing: .12em; }.hero-strip h2 { margin: 11px 0 5px; font-size: 24px; }.hero-strip h2 em { color: #ff8c96; font-style: normal; }.hero-strip p { margin: 0; color: #d9c7c9; font-size: 13px; }.ghost-light { position: relative; z-index: 1; padding: 9px 13px; color: white; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.19); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }.metric-card { min-height: 112px; padding: 18px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 4px 16px rgba(20,22,24,.035); }.metric-card header { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #fff0f1; color: var(--brand-red); }.metric-card strong { display: block; margin-top: 10px; font-size: 25px; line-height: 1; }.metric-card footer { margin-top: 7px; color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }.span-2 { grid-column: span 2; }.span-3 { grid-column: span 3; }.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 5px 20px rgba(26,67,58,.035); overflow: hidden; }.panel-head { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }.panel-head h3 { margin: 0; font-size: 15px; }.legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; }.legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }.green-dot::before { background: var(--green); }.amber-dot::before { background: var(--amber); }.red-dot::before { background: var(--red); }
.health-layout { min-height: 210px; padding: 12px 26px 24px; display: flex; align-items: center; gap: 40px; }.donut { --rate: 0; flex: 0 0 142px; width: 142px; height: 142px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--rate) * 1%), #e6eeeb 0); display: grid; place-items: center; position: relative; }.donut::after { content: ""; width: 99px; height: 99px; border-radius: 50%; background: white; position: absolute; }.donut div { z-index: 1; text-align: center; }.donut strong, .donut span { display: block; }.donut strong { font-size: 27px; }.donut span { color: var(--muted); font-size: 10px; }.health-bars { flex: 1; display: grid; gap: 19px; }.health-bar-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }.health-bar-label span { color: var(--muted); }.bar-track { height: 6px; border-radius: 10px; background: #edf1ef; overflow: hidden; }.bar-fill { height: 100%; border-radius: 10px; }
.mini-link { border: 0; background: none; color: var(--brand-red); font-size: 11px; }.attention-list { padding: 0 16px 13px; }.attention-item { display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: start; padding: 12px 5px; border-top: 1px solid #edf1ef; }.attention-item i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; }.attention-item strong, .attention-item span { display: block; }.attention-item strong { font-size: 11px; }.attention-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }.attention-item time { color: var(--red); font-size: 10px; }
.table-wrap { overflow-x: auto; }table { width: 100%; border-collapse: collapse; }th { padding: 10px 16px; background: #f7f9f8; color: #71827e; text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; }td { padding: 14px 16px; border-top: 1px solid #edf1ef; font-size: 11px; vertical-align: middle; }td strong, td small { display: block; }td small { margin-top: 3px; color: var(--muted); }.table-wrap.wide { min-height: 430px; }.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }.status.ontrack { color: #197659; background: #e8f6f0; }.status.ontrack::before { background: var(--green); }.status.risk { color: #9e6413; background: #fff4df; }.status.risk::before { background: var(--amber); }.status.delayed { color: #a53e33; background: #fdebe8; }.status.delayed::before { background: var(--red); }.allocation-lines { display: flex; flex-wrap: wrap; gap: 5px; }.allocation-chip { padding: 3px 6px; border-radius: 5px; color: #315d53; background: #edf5f2; white-space: nowrap; font-size: 9px; }.shortage { color: var(--red); font-weight: 700; }.row-action { border: 0; background: none; color: var(--muted); font-size: 17px; }
.section-toolbar, .split-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }.filter-tabs { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: white; }.filter-tabs button { padding: 7px 14px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; }.filter-tabs button.active { color: white; background: var(--forest); }.split-title h2 { margin: 0 0 4px; font-size: 19px; }.split-title p { margin: 0; color: var(--muted); font-size: 11px; }.split-title select { min-width: 190px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; }
.inventory-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }.inventory-card { padding: 17px 18px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; background: white; }.inventory-card header { display: flex; justify-content: space-between; }.inventory-card h3 { margin: 0; font-size: 14px; }.inventory-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }.inventory-card strong { display: block; margin: 16px 0 5px; font-size: 22px; }.inventory-card footer { display: flex; gap: 12px; color: var(--muted); font-size: 9px; }.confidence { padding: 3px 7px; border-radius: 5px; background: #eef4f2; color: var(--green); }
.timeline-panel { padding: 22px; }.timeline-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 25px; }.summary-box { padding: 13px; border-radius: 9px; background: #f5f8f7; }.summary-box span, .summary-box strong { display: block; }.summary-box span { color: var(--muted); font-size: 9px; }.summary-box strong { margin-top: 5px; font-size: 18px; }.timeline-list { position: relative; padding-left: 26px; }.timeline-list::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }.timeline-event { position: relative; display: grid; grid-template-columns: 100px 1fr auto; gap: 20px; padding: 0 0 23px; }.timeline-event::before { content: ""; position: absolute; left: -24px; top: 5px; width: 9px; height: 9px; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }.timeline-event.supply::before { background: var(--green); box-shadow: 0 0 0 1px var(--green); }.timeline-event.demand::before { background: var(--red); box-shadow: 0 0 0 1px var(--red); }.timeline-event time { color: var(--muted); font-size: 11px; }.timeline-event strong { font-size: 12px; }.timeline-event small { display: block; color: var(--muted); margin-top: 3px; }.timeline-event b { font-size: 12px; }
.exception-list { display: grid; gap: 10px; }.exception-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }.exception-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: #fdebe8; color: var(--red); font-size: 19px; }.exception-card h3 { margin: 0 0 5px; font-size: 13px; }.exception-card p { margin: 0; color: var(--muted); font-size: 10px; }.exception-impact { text-align: right; }.exception-impact strong, .exception-impact span { display: block; }.exception-impact strong { color: var(--red); }.exception-impact span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.schedule-actions { display:flex;align-items:center;gap:10px; }.schedule-actions label { display:flex;align-items:center;gap:8px;color:var(--muted);font-size:11px; }.schedule-actions input { width:110px;padding:9px 10px;border:1px solid var(--line);border-radius:8px; }.schedule-metrics { display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px; }.schedule-stat { padding:15px 17px;border:1px solid var(--line);border-radius:11px;background:white; }.schedule-stat span,.schedule-stat strong { display:block; }.schedule-stat span { color:var(--muted);font-size:9px;letter-spacing:.05em; }.schedule-stat strong { margin-top:6px;font-size:20px; }.schedule-board { min-width:780px;padding:0 18px 20px; }.schedule-day { display:grid;grid-template-columns:105px 125px 1fr 105px 80px;gap:12px;align-items:center;padding:13px 4px;border-top:1px solid #edf1ef; }.schedule-day.over { background:linear-gradient(90deg,transparent,#fff8f6); }.schedule-date strong,.schedule-date span { display:block; }.schedule-date strong { font-size:11px; }.schedule-date span { margin-top:3px;color:var(--muted);font-size:9px; }.capacity-meter { min-width:100px; }.capacity-meter .bar-track { margin-top:5px; }.shipment-card { padding:10px 12px;border:1px solid var(--line);border-left:3px solid var(--green);border-radius:8px;background:#fbfdfc; }.shipment-card.waiting { border-left-color:var(--amber); }.shipment-card.overdue { border-left-color:var(--red); }.shipment-card strong,.shipment-card small { display:block; }.shipment-card strong { font-size:11px; }.shipment-card small { margin-top:3px;color:var(--muted);font-size:9px; }.schedule-day .row-action { justify-self:end; }.schedule-status { font-size:9px;color:var(--muted); }
.source-pill { padding:5px 9px;border-radius:20px;color:#a0000d;background:#fff0f1;font-size:9px;font-weight:700; }.material-search-panel { padding:24px;border-radius:14px;color:white;background:linear-gradient(120deg,#111214,#700811);box-shadow:var(--shadow); }.material-search-panel .section-kicker { color:#d8b9bc; }.material-search-panel h3 { margin:4px 0 15px;font-size:18px; }.material-search { display:flex;align-items:center;max-width:620px;border-radius:9px;background:white;overflow:hidden; }.material-search > span { padding-left:13px;color:var(--muted);font-size:18px; }.material-search input { flex:1;min-width:0;padding:12px;border:0;outline:0; }.material-search button { align-self:stretch;padding:0 20px;border:0;color:white;background:var(--brand-red);font-weight:700; }.material-results { display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:16px; }.material-card { padding:18px;border:1px solid var(--line);border-radius:12px;background:white; }.material-card header { display:flex;justify-content:space-between;gap:12px; }.material-card h3 { margin:0;font-size:14px; }.material-card p { margin:4px 0 0;color:var(--muted);font-size:10px; }.material-card dl { display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:17px 0 0; }.material-card dl div { padding:9px;border-radius:7px;background:#f6f6f6; }.material-card dt { color:var(--muted);font-size:8px; }.material-card dd { margin:4px 0 0;font-size:12px;font-weight:700; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(17,18,20,.58); backdrop-filter: blur(4px); }.modal-backdrop[hidden] { display: none; }.modal { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 28px; border-radius: 16px; background: white; box-shadow: 0 25px 70px rgba(0,0,0,.25); position: relative; }.modal h2 { margin: 0 0 23px; }.modal-close { position: absolute; right: 18px; top: 17px; border: 0; background: none; color: var(--muted); font-size: 23px; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.field { display: grid; gap: 6px; }.field.full { grid-column: 1 / -1; }.field label { color: var(--muted); font-size: 10px; font-weight: 600; }.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; outline: 0; }.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(227,0,18,.1); }.field textarea { min-height: 72px; resize: vertical; }.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; padding: 11px 16px; border-left:3px solid var(--brand-red); border-radius: 9px; color: white; background: #202124; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s; font-size: 11px; }.toast.show { opacity: 1; transform: translateY(0); }
.empty { padding: 36px; color: var(--muted); text-align: center; font-size: 12px; }.progress { width: 100px; height: 5px; margin-bottom: 5px; background: #ebf0ee; border-radius: 10px; overflow: hidden; }.progress i { display: block; height: 100%; background: var(--green); }.muted { color: var(--muted); }
@media (max-width: 980px) { .app-shell { grid-template-columns: 76px minmax(0,1fr); }.sidebar { width: 76px; padding: 20px 11px 24px; }.brand { padding:10px 8px;margin-bottom:20px; }.brand-logo-box { width:38px;height:31px; }.brand-logo-box img { width:145px;max-width:none; }.brand > div:last-child, .nav-item:not(.active) b, .nav-item { font-size: 0; }.nav-item { justify-content: center; padding: 13px; }.nav-item span { font-size: 18px; }.nav-item b { font-size: 9px; position: absolute; margin: -23px 0 0 22px; }.engine-status div, .text-button { display: none; }.engine-status { justify-content: center; }.topbar { align-items: flex-start; padding-top: 25px; }.search { display: none; }.role-switch span { display:none; }main { grid-column: 2; padding: 0 20px 30px; }.metric-grid { grid-template-columns: repeat(2,1fr); }.dashboard-grid { grid-template-columns: 1fr; }.span-2,.span-3 { grid-column: span 1; }.inventory-cards { grid-template-columns: 1fr 1fr; }.schedule-metrics { grid-template-columns:1fr 1fr; }.schedule-actions { align-items:flex-end;flex-direction:column; }.material-results { grid-template-columns:1fr 1fr; } }
@media (max-width: 640px) { .topbar { min-height: 92px; }.top-actions .icon-button,.role-switch { display: none; }.primary-button { padding: 0 11px; }.hero-strip { padding: 24px; }.hero-strip .ghost-light { display: none; }.hero-strip h2 { font-size: 20px; }.metric-grid, .inventory-cards,.material-results { grid-template-columns: 1fr; }.health-layout { align-items: flex-start; flex-direction: column; }.health-bars { width: 100%; }.form-grid { grid-template-columns: 1fr; }.field.full,.form-actions { grid-column: 1; }.timeline-event { grid-template-columns: 78px 1fr; }.timeline-event b { grid-column: 2; }.exception-card { grid-template-columns: 38px 1fr; }.exception-impact { grid-column: 2; text-align: left; } }
