:root {
  --bg: #0b1120;
  --bg-soft: #101a2d;
  --card: rgba(255,255,255,.055);
  --card-strong: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.095);
  --text: #e8eef8;
  --muted: #8c9bb3;
  --faint: #60708a;
  --accent: #6d7cff;
  --accent-2: #9b72ff;
  --blue: #62b8ff;
  --green: #62d991;
  --yellow: #f3c96b;
  --red: #ff7179;
  --orange: #ff9c5b;
  --shadow: 0 18px 55px rgba(0,0,0,.24);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.4,0,.2,1);
}
[data-theme="light"] {
  --bg: #f3f6fb;
  --bg-soft: #eaf0f8;
  --card: #fff;
  --card-strong: #fff;
  --line: #e1e7f0;
  --text: #182336;
  --muted: #65748c;
  --faint: #96a4b8;
  --shadow: 0 18px 45px rgba(31,48,76,.1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(5px); opacity: .5; z-index: 0; }
.ambient-one { width: 620px; height: 460px; right: -180px; top: -260px; background: radial-gradient(circle, rgba(99,114,255,.28), transparent 66%); }
.ambient-two { width: 520px; height: 380px; left: -260px; bottom: -220px; background: radial-gradient(circle, rgba(47,190,190,.14), transparent 67%); }
.shell { position: relative; z-index: 1; min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; gap: 24px; padding: 0 34px; background: rgba(10,17,32,.86); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
[data-theme="light"] .topbar { background: #0e1729; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 245px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 25px rgba(109,124,255,.33); font-weight: 800; letter-spacing: -.08em; }
.brand-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: #eef3ff; }
.brand-sub { margin-top: 2px; color: #8798b4; font-size: 11px; }
.nav-tabs { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab { border: 0; color: #91a1ba; background: transparent; padding: 10px 14px; border-radius: 9px; white-space: nowrap; transition: .18s var(--ease); }
.nav-tab:hover { color: #eaf0ff; background: rgba(255,255,255,.06); }
.nav-tab.active { color: white; background: rgba(117,127,255,.19); box-shadow: inset 0 0 0 1px rgba(145,153,255,.22); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.theme-btn, .icon-btn { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.05); color: #b9c6da; }
.theme-btn:hover, .icon-btn:hover { background: rgba(255,255,255,.11); color: white; }
.user-pill { display: flex; align-items: center; gap: 8px; color: #b9c6da; font-size: 13px; }
.user-menu { position: relative; }
.user-pill.clickable { cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); transition: background .15s; }
.user-pill.clickable:hover { background: rgba(255,255,255,.11); color: #fff; }
.user-caret { font-size: 9px; opacity: .7; margin-left: 2px; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: #141b2b; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.45); padding: 6px; z-index: 90; display: none; }
.user-dropdown.open { display: block; }
.user-dropdown .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid rgba(255,255,255,.09); margin-bottom: 6px; }
.user-dropdown .dd-name { color: #eef3ff; font-size: 13px; font-weight: 600; }
.user-dropdown .dd-role { color: #8996aa; font-size: 11px; margin-top: 2px; }
.user-dropdown button { width: 100%; text-align: left; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: #b9c6da; font-size: 13px; cursor: pointer; }
.user-dropdown button:hover { background: rgba(255,255,255,.08); color: #fff; }
.user-dropdown button.danger:hover { background: rgba(255,87,87,.14); color: #ff8e8e; }
[data-theme="light"] .user-dropdown { background: #fff; border-color: rgba(18,26,44,.12); box-shadow: 0 18px 40px rgba(18,26,44,.14); }
[data-theme="light"] .user-dropdown .dd-name { color: #16203a; }
[data-theme="light"] .user-dropdown button { color: #45526b; }
[data-theme="light"] .user-dropdown button:hover { background: rgba(18,26,44,.06); color: #16203a; }
.avatar { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg,#28c7c1,#4f7cff); color: white; font-size: 12px; font-weight: 700; }
.main { max-width: 1480px; margin: 0 auto; padding: 32px 34px 54px; }
.page-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 26px; gap: 20px; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
h1 { margin: 7px 0 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; line-height: 1.1; }
.head-copy { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.primary { border: 0; color: white; padding: 11px 16px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px rgba(109,124,255,.24); transition: .18s var(--ease); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(109,124,255,.36); }
.ghost { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 10px 14px; border-radius: 9px; }
.ghost:hover { background: var(--card-strong); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.stats { display: grid; grid-template-columns: repeat(7, minmax(125px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { padding: 17px 17px 15px; min-height: 128px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--c), transparent); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { color: var(--c); font-variant-numeric: tabular-nums; font-size: 35px; line-height: 1.05; font-weight: 720; margin: 15px 0 8px; letter-spacing: -.06em; }
.stat-note { color: var(--faint); font-size: 11px; }
.stat-icon { position: absolute; right: 13px; top: 16px; opacity: .1; color: var(--c); font-size: 29px; font-weight: 800; }
.stat.alert { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 26%, transparent), var(--shadow); }
.stat.alert.hot { animation: breathe 2.7s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 8%, transparent), var(--shadow); } }
.grid-2 { display: grid; grid-template-columns: 1fr 1.36fr; gap: 18px; margin-bottom: 18px; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title { font-size: 15px; font-weight: 650; }
.panel-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chart-wrap { min-height: 245px; display: grid; place-items: center; }
.donut { width: 185px; height: 185px; border-radius: 50%; background: conic-gradient(var(--yellow) 0 20%, var(--blue) 20% 46%, var(--green) 46% 65%, #6f7b91 65% 100%); position: relative; display: grid; place-items: center; }
.donut::after { content: ""; width: 118px; height: 118px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 50%; position: absolute; }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 28px; letter-spacing: -.05em; }
.donut-center span { font-size: 11px; color: var(--muted); }
.legend { display: grid; gap: 9px; margin-left: 20px; min-width: 120px; }
.legend-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.legend-label { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 17px; padding: 14px 0 4px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 12px; font-size: 12px; }
.bar-name { color: var(--muted); white-space: nowrap; }
.bar-track { height: 14px; border-radius: 5px; overflow: hidden; display: flex; background: rgba(255,255,255,.05); }
.bar-segment { height: 100%; }
.bar-total { font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }
.attention { overflow: hidden; }
.attention-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.attention-table th { text-align: left; color: var(--faint); font-size: 11px; font-weight: 500; padding: 0 14px 12px; }
.attention-table td { padding: 13px 14px; border-top: 1px solid var(--line); color: var(--muted); }
.attention-table tr { cursor: pointer; transition: background .16s; }
.attention-table tbody tr:hover { background: rgba(255,255,255,.04); }
.attention-table td:nth-child(2), .attention-table td:nth-child(4) { color: var(--text); }
.alert-type { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.alert-type.overdue { color: var(--red); }
.alert-type.stalled { color: var(--orange); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; border: 1px solid color-mix(in srgb, var(--bc) 30%, transparent); color: var(--bc); background: color-mix(in srgb, var(--bc) 13%, transparent); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bc); }
.toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 16px; }
.field, .select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; outline: none; }
.field:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,124,255,.14); }
.search { min-width: 220px; flex: 1; }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; }
.table-shell { overflow: auto; border-radius: var(--radius); }
.data-table { width: 100%; min-width: 1160px; border-collapse: collapse; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 1; text-align: left; color: var(--faint); font-weight: 500; font-size: 11px; padding: 13px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255,255,255,.035); }
.data-table td:first-child, .data-table th:first-child { position: sticky; left: 0; z-index: 2; background: var(--bg-soft); }
.data-table td:nth-child(2), .data-table td:nth-child(5) { color: var(--text); }
.truncate { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-cell { cursor: pointer; transition: color .16s var(--ease), background .16s var(--ease); }
.summary-cell:hover { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.summary-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-chevron { flex: 0 0 auto; color: var(--faint); font-size: 14px; transition: transform .18s var(--ease); }
.summary-cell.open .summary-chevron { transform: rotate(180deg); color: var(--accent); }
.detail-row td { padding: 0; background: color-mix(in srgb, var(--blue) 4%, var(--bg)); }
.issue-detail { padding: 19px 24px 20px 82px; border-bottom: 1px solid var(--line); }
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.detail-kicker { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.detail-hint { color: var(--faint); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: 1.25fr 1fr 180px; gap: 14px; }
.detail-block { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.detail-label { color: var(--faint); font-size: 10px; margin-bottom: 8px; letter-spacing: .06em; }
.detail-value { color: var(--text); font-size: 12px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.detail-value[title] { cursor: text; }
.detail-value[title]:hover { color: var(--accent); }
.detail-value.muted { color: var(--muted); }
.detail-meta { display: grid; gap: 10px; }
.detail-meta-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.detail-meta-row strong { color: var(--text); font-weight: 550; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: var(--sc); font-variant-numeric: tabular-nums; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.stock.notfound { color: var(--faint); font-style: italic; }
.stock.notfound::before { display: none; }
.material-row td { background: color-mix(in srgb, var(--accent) 5%, var(--bg)); padding: 0; }
.material-inner { padding: 15px 22px 16px 82px; }
.material-list { display: grid; gap: 8px; }
.material-line { display: grid; grid-template-columns: 95px 1.7fr 70px 100px 100px 80px; gap: 12px; align-items: center; color: var(--muted); font-size: 11px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.material-line.head { color: var(--faint); border-bottom: 1px solid var(--line); }
.material-add { margin-top: 11px; color: var(--accent); font-size: 12px; }
.inventory-grid, .settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.settings-card { padding: 20px; }
.settings-list { display: grid; gap: 0; }
.settings-item { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.settings-item:last-child { border-bottom: 0; }
.settings-label { color: var(--muted); font-size: 13px; }
.settings-value { color: var(--text); font-size: 13px; text-align: right; }
.switch { width: 38px; height: 22px; padding: 2px; border-radius: 99px; border: 0; background: var(--accent); }
.switch::after { content: ""; display: block; width: 18px; height: 18px; background: white; border-radius: 50%; margin-left: 14px; }
.subproject-list { display: grid; gap: 9px; }
.subproject-row { display: grid; grid-template-columns: 70px 1fr 80px 90px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; }
.subproject-actions { display:flex; justify-content:flex-end; gap:7px; }
.subproject-row strong { color: var(--text); }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-mark { width: 50px; height: 50px; margin: 0 auto 14px; border: 1px dashed var(--faint); border-radius: 15px; display: grid; place-items: center; color: var(--accent); font-size: 22px; }
.toast { position: fixed; right: 25px; bottom: 24px; z-index: 30; background: #17243a; color: #e9f0ff; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 12px 15px; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .22s var(--ease); font-size: 13px; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 2; }
.login-card { width: min(430px, 100%); padding: 34px; }
.login-card h1 { font-size: 30px; margin-top: 18px; }
.login-card .field { width: 100%; margin-top: 12px; }
.login-card .primary { width: 100%; margin-top: 18px; }
.login-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 14px; }
.toast.show { transform: translateY(0); opacity: 1; }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(4,8,18,.68); backdrop-filter: blur(8px); }
.modal { width: min(680px, 100%); max-height: 90vh; overflow: auto; padding: 22px; }
.modal-head { display:flex; justify-content:space-between; align-items:start; gap:16px; margin-bottom:18px; }
.modal-title { font-size:18px; font-weight:650; }
.modal-sub { color:var(--muted); font-size:12px; margin-top:5px; }
.modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.modal-grid .full { grid-column:1 / -1; }
.modal label { display:grid; gap:7px; color:var(--muted); font-size:12px; }
.modal textarea { min-height:108px; resize:vertical; }
.modal-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:18px; }
.modal-error { color:var(--red); font-size:12px; margin-top:10px; }
.demo-strip { margin: -10px 0 22px; padding: 10px 14px; border-radius: 10px; color: #c8d6ff; background: rgba(92,110,255,.13); border: 1px solid rgba(120,137,255,.2); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; }
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(4, 1fr); } .brand { min-width: 210px; } }
@media (max-width: 800px) { .topbar { height: auto; min-height: 72px; padding: 12px 16px; flex-wrap: wrap; gap: 12px; } .brand { min-width: 0; flex: 1; } .nav-tabs { order: 3; flex-basis: 100%; } .main { padding: 24px 16px 42px; } .page-head { align-items: start; flex-direction: column; } .stats { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } .user-pill span:not(.avatar):not(.user-caret) { display: none; } .attention-table { min-width: 720px; } }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } .issue-detail { padding-left: 24px; } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; gap: 8px; } .stat { min-height: 112px; padding: 13px; } .stat-value { font-size: 28px; margin-top: 12px; } h1 { font-size: 28px; } }
