:root{--bg: #f5f6f8;--surface: #ffffff;--border: #d8dde3;--text: #1d2433;--text-muted: #5b6473;--primary: #1f4e96;--primary-hover: #163c75;--accent: #d65a00;--danger: #c0392b;--success: #1e8e54;font-family:Segoe UI,-apple-system,Hiragino Sans,Yu Gothic UI,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:14px}button{font-family:inherit;cursor:pointer}a{color:var(--primary);text-decoration:none}.app-shell{min-height:100vh;display:grid;grid-template-columns:220px 1fr}.sidebar{position:relative;overflow:hidden;background:#000;color:#e6fffa;padding:0}.sidebar .particle-canvas{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none}.sidebar-content{position:relative;z-index:1;padding:20px 0}.sidebar .brand{font-size:24px;font-weight:700;letter-spacing:.15em;text-align:center;color:#2dd4bf;margin-bottom:4px;text-shadow:0 0 12px rgba(45,212,191,.45)}.sidebar .brand-sub{text-align:center;font-size:11px;color:#8ba8a3;margin-bottom:28px}.sidebar nav a{display:block;padding:11px 22px;color:#c8eee6;font-size:14px;border-left:3px solid transparent;transition:background .18s ease,color .18s ease,border-color .18s ease}.sidebar nav a:hover{background:#2dd4bf14;color:#fff}.sidebar nav a.active{background:#2dd4bf29;border-left-color:#2dd4bf;color:#fff}.sidebar .footer{margin-top:32px;padding:0 22px;font-size:11px;color:#5e7a76}.main{display:flex;flex-direction:column;min-width:0}.topbar{background:var(--surface);border-bottom:1px solid var(--border);height:52px;display:flex;align-items:center;justify-content:space-between;padding:0 24px}.topbar .page-title{font-size:16px;font-weight:600}.topbar .user{font-size:13px;color:var(--text-muted);display:flex;align-items:center;gap:12px}.topbar .user button{background:transparent;border:1px solid var(--border);color:var(--text);padding:5px 12px;border-radius:4px}.content{padding:24px;flex:1;overflow:auto}.btn{border:1px solid var(--primary);background:var(--primary);color:#fff;padding:7px 14px;border-radius:4px;font-size:13px}.btn:hover{background:var(--primary-hover);border-color:var(--primary-hover)}.btn-secondary{background:var(--surface);color:var(--primary)}.btn-secondary:hover{background:#eef2f8}.btn-danger{background:var(--danger);border-color:var(--danger)}.btn-danger:hover{background:#962b1f;border-color:#962b1f}.card{background:var(--surface);border:1px solid var(--border);border-radius:6px;padding:20px}.card+.card{margin-top:16px}input,select,textarea{font-family:inherit;font-size:14px;padding:6px 8px;border:1px solid var(--border);border-radius:4px;background:#fff}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px #1f4e9626}.toolbar{display:flex;gap:8px;margin-bottom:16px;align-items:center}.toolbar .spacer{flex:1}.search-box{width:280px}.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#11243f,#1f4e96)}.login-card{width:360px;background:#fff;border-radius:8px;padding:36px 32px;box-shadow:0 10px 40px #00000040}.login-card h1{margin:0 0 4px;text-align:center;font-size:28px;letter-spacing:.15em;color:var(--primary)}.login-card .login-sub{text-align:center;font-size:12px;color:var(--text-muted);margin-bottom:28px}.login-card label{display:block;margin-bottom:14px;font-size:13px;color:var(--text-muted)}.login-card label input{width:100%;margin-top:4px}.login-card button{width:100%;margin-top:8px;padding:10px;border-radius:4px;border:none;background:var(--primary);color:#fff;font-size:14px;font-weight:600}.login-card button:hover{background:var(--primary-hover)}.login-note{margin-top:20px;font-size:11px;color:var(--text-muted);text-align:center}table.data{width:100%;border-collapse:collapse;font-size:13px;background:var(--surface)}table.data th,table.data td{border:1px solid var(--border);padding:8px 10px;text-align:left;vertical-align:middle}table.data th{background:#eef2f8;font-weight:600;font-size:12px;color:var(--text-muted);letter-spacing:.04em}table.data tr:hover td{background:#fafbfd}table.data .num{text-align:right;font-variant-numeric:tabular-nums}.estimate-grid{border:1px solid var(--border);border-radius:4px;overflow:hidden}.estimate-grid table{width:100%;border-collapse:collapse;font-size:13px;background:var(--surface)}.estimate-grid th,.estimate-grid td{border:1px solid var(--border);padding:0;vertical-align:middle}.estimate-grid th{background:#eef2f8;font-weight:600;font-size:12px;color:var(--text-muted);padding:8px 10px}.estimate-grid td input,.estimate-grid td select{width:100%;border:none;padding:6px 8px;background:transparent;border-radius:0;font-size:13px}.estimate-grid td input:focus,.estimate-grid td select:focus{background:#fff8e0;box-shadow:inset 0 0 0 2px var(--accent)}.estimate-grid td.num{text-align:right;font-variant-numeric:tabular-nums;padding:6px 10px}.estimate-grid tr.level-1 td{background:#e3ebf6;font-weight:700}.estimate-grid tr.level-2 td{background:#f1f4fa;font-weight:600}.estimate-grid tr.level-3 td{background:#f8f9fb}.estimate-grid tr.level-4 td{background:var(--surface)}.estimate-grid tr.level-5 td,.estimate-grid tr.row-subtotal td{background:#dde7f3;color:#1f4e96;font-weight:700;border-top:2px solid #b8c8df;border-bottom:2px solid #b8c8df}.estimate-grid tr.row-subtotal td.level-col{background:#dde7f3;color:#1f4e96}.estimate-grid tr.row-subtotal input{color:#1f4e96;background:transparent}.estimate-grid tr.row-subtotal input:focus{background:#fff8e0;box-shadow:inset 0 0 0 2px var(--accent)}.estimate-grid tr.row-subtotal input:disabled{color:#6987b3}.estimate-grid tr.row-locked td{background:#f0f1f4!important;color:#8e96a5}.estimate-grid tr.row-locked input,.estimate-grid tr.row-locked select{color:#8e96a5;cursor:not-allowed}.estimate-grid tr.row-locked input:disabled,.estimate-grid tr.row-locked select:disabled{background:transparent}.estimate-grid tr.row-selected td{background:#e8f2ff!important}.estimate-grid td.level-col{color:#5b6473;background:#f4f6fa}.estimate-grid tr.row-active-section td.level-col{background:#c8d4e6;color:#1f4e96;font-weight:700}.estimate-grid tr.row-active-section.level-1 td.level-col{background:#6987b3;color:#fff;font-weight:700}.estimate-grid td{transition:box-shadow .28s ease,background-color .2s ease}.estimate-grid tr.row-active-section td:first-child{box-shadow:inset 3px 0 0 0 var(--primary)}.estimate-grid tr.row-active-section td:last-child{box-shadow:inset -3px 0 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-first td{box-shadow:inset 0 3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-last td{box-shadow:inset 0 -3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-first td:first-child{box-shadow:inset 3px 0 0 0 var(--primary),inset 0 3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-first td:last-child{box-shadow:inset -3px 0 0 0 var(--primary),inset 0 3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-last td:first-child{box-shadow:inset 3px 0 0 0 var(--primary),inset 0 -3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-last td:last-child{box-shadow:inset -3px 0 0 0 var(--primary),inset 0 -3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-first.section-last td:first-child{box-shadow:inset 3px 0 0 0 var(--primary),inset 0 3px 0 0 var(--primary),inset 0 -3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-first.section-last td:last-child{box-shadow:inset -3px 0 0 0 var(--primary),inset 0 3px 0 0 var(--primary),inset 0 -3px 0 0 var(--primary)}.estimate-grid tr.row-active-section.section-first.section-last td:not(:first-child):not(:last-child){box-shadow:inset 0 3px 0 0 var(--primary),inset 0 -3px 0 0 var(--primary)}.estimate-grid tr.level-1 td{cursor:pointer}.estimate-grid tr.row-dragging{opacity:.4}.estimate-grid td.drag-handle{cursor:grab;text-align:center;color:#aab1bd;font-weight:700;-webkit-user-select:none;user-select:none;padding:6px}.estimate-grid tr.row-locked td.drag-handle{cursor:not-allowed;color:#6b7280}.estimate-grid td.drag-handle:active{cursor:grabbing}.estimate-grid input[type=checkbox]{cursor:pointer}.tree-cell{display:flex;align-items:center;width:100%}.tree-cell .tree-mark{flex:0 0 auto;font-family:Consolas,Courier New,monospace;font-size:12px;color:#aab1bd;-webkit-user-select:none;user-select:none;white-space:pre;padding:0 4px 0 6px;line-height:1}.tree-cell-input{flex:1 1 auto;min-width:0}.estimate-grid tr.level-2 .tree-mark{color:#5b6f8a}.estimate-grid tr.level-3 .tree-mark{color:#7a8aa3}.estimate-grid tr.level-4 .tree-mark{color:#9ba8bd}.estimate-grid tr.level-1 .tree-cell-input input{font-weight:700}.estimate-grid tr.level-2 .tree-cell-input input{font-weight:600}.row-actions button{border:1px solid var(--border);background:var(--surface);font-size:11px;padding:3px 6px;border-radius:3px;margin:0 2px}.estimate-header{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}.estimate-header label{display:flex;flex-direction:column;font-size:12px;color:var(--text-muted);gap:4px}.estimate-header input.is-empty,input.is-empty{border-color:var(--danger);box-shadow:0 0 0 2px #c0392b2e;background:#fff5f5}.field-error{color:var(--danger);font-size:11px;margin-top:2px}.estimate-header label input,.estimate-header label select{font-size:13px}.summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-top:16px}.summary .stat{background:#f8f9fc;border:1px solid var(--border);border-radius:4px;padding:10px 14px}.summary .stat .label{font-size:11px;color:var(--text-muted)}.summary .stat .value{font-size:18px;font-variant-numeric:tabular-nums;font-weight:600}.summary .stat.total{background:var(--primary);color:#fff;border-color:var(--primary)}.summary .stat.total .label{color:#ffffffb3}.save-indicator{font-size:12px;color:var(--text-muted)}.save-indicator.saving{color:var(--accent)}.save-indicator.saved{color:var(--success)}.badge{display:inline-block;font-size:11px;padding:2px 7px;border-radius:10px;background:#eef2f8;color:var(--text-muted)}.badge.draft{background:#fdf0d5;color:#8a5a00}.badge.final{background:#d8efe2;color:#166937}.lock-banner{margin-bottom:16px;padding:12px 16px;background:#fff5e6;border-left:4px solid var(--accent);border-radius:4px;color:var(--text);font-size:13px;box-shadow:0 1px 3px #00000014}fieldset:disabled input,fieldset:disabled select,fieldset:disabled button:not(.always-enabled),fieldset:disabled textarea{cursor:not-allowed;opacity:.7}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f162473;display:flex;align-items:center;justify-content:center;z-index:100}.modal{background:#fff;border-radius:8px;width:380px;box-shadow:0 20px 60px #0000004d;overflow:hidden}.modal-title{padding:14px 20px;background:#f4f6fa;border-bottom:1px solid var(--border);font-weight:600}.modal-body{padding:20px;font-size:14px;line-height:1.7;color:var(--text)}.modal-actions{padding:12px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px;background:#fafbfd}.ac-wrap{position:relative}.ac-wrap input{width:100%;border:none;padding:6px 8px;background:transparent;border-radius:0;font-size:13px}.ac-wrap input:focus{background:#fff8e0;box-shadow:inset 0 0 0 2px var(--accent)}.ac-list{position:absolute;top:100%;left:0;right:0;margin:0;padding:4px 0;list-style:none;background:#fff;border:1px solid var(--border);border-radius:4px;box-shadow:0 8px 24px #0000001f;z-index:50;max-height:260px;overflow:auto;min-width:320px}.ac-list li{padding:6px 12px;font-size:12px;cursor:pointer;display:grid;grid-template-columns:1fr 2fr auto;gap:10px;align-items:center;border-bottom:1px solid #f0f2f5}.ac-list li:last-child{border-bottom:none}.ac-list li.hi,.ac-list li:hover{background:#eef2f8}.ac-list .ac-name{font-weight:600;color:var(--text)}.ac-list .ac-spec{color:var(--text-muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ac-list .ac-unit{font-size:11px;color:var(--text-muted);background:#f0f2f5;padding:2px 8px;border-radius:10px}.estimate-grid td select{width:100%;border:none;padding:6px 8px;background:transparent;font-size:13px;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.estimate-grid td select:focus{background:#fff8e0;box-shadow:inset 0 0 0 2px var(--accent)}
