:root{--bg:#f7f8fc;--surface:#fff;--border:#e6e9f0;--text:#0f172a;--muted:#64748b;--accent:#ec4899}*{box-sizing:border-box}body{margin:0;font-family:"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text)}.layout{min-height:100vh;display:grid;grid-template-columns:260px 1fr;transition:grid-template-columns .2s ease}.layout.collapsed{grid-template-columns:72px 1fr}.sidebar{background:var(--surface);border-right:1px solid var(--border);padding:12px 10px;overflow:hidden}.brand{display:flex;align-items:center;justify-content:space-between;margin:0 4px 12px}.brand-text{font-size:13px;font-weight:700;letter-spacing:.8px}.toggle{border:1px solid #cbd5e1;background:#fff;border-radius:8px;width:30px;height:30px;cursor:pointer}.section-title{margin:10px 6px 6px;font-size:11px;color:#6b7280;text-transform:uppercase;letter-spacing:.8px}.menu-item{display:flex;align-items:center;gap:8px;text-decoration:none;color:#1f2937;padding:8px;border-radius:10px;border:1px solid transparent;font-size:13px;white-space:nowrap}.menu-item:hover{background:#f8fafc;border-color:#dbe2ea}.menu-item.active{background:#ecfdf5;border-color:#a7f3d0;color:#065f46;font-weight:600}.icon{width:16px;height:16px;flex:0 0 16px}.icon svg{width:100%;height:100%;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.layout.collapsed .brand-text,.layout.collapsed .section-title,.layout.collapsed .label{display:none}.content{padding:12px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px;height:calc(100vh - 24px);display:flex;flex-direction:column}.topbar{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px;flex-wrap:wrap}h1{margin:0;font-size:22px}.sub{margin:4px 0 0;color:var(--muted);font-size:13px}.actions{display:flex;gap:8px;flex-wrap:wrap}.btn{border:1px solid #cbd5e1;background:#fff;border-radius:8px;padding:7px 10px;font-size:13px;cursor:pointer}.btn.primary{background:var(--accent);border-color:#db2777;color:#fff}.table-wrap{flex:1;min-height:0;overflow:auto;border:1px solid var(--border);border-radius:10px;background:#fff}table{width:100%;border-collapse:collapse}th,td{border-bottom:1px solid var(--border);text-align:left;padding:8px 7px;font-size:13px}th{color:#334155;background:#f8fafc;font-weight:600}@media (max-width:920px){.layout,.layout.collapsed{grid-template-columns:1fr}.sidebar{border-right:0;border-bottom:1px solid var(--border)}.panel{height:auto}.layout.collapsed .brand-text,.layout.collapsed .section-title,.layout.collapsed .label{display:initial}}

  .status-wip{background:#d1fae5;color:#065f46}
  .status-issue{background:#fee2e2;color:#991b1b}
  .status-awaiting{background:#fef3c7;color:#92400e}
  .status-completed{background:#dcfce7;color:#14532d}
  .wo-detail-row{background:#f8fafc}
  .detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:12px 14px}
  .detail-section{background:#fff;border:1px solid #e6e9f0;border-radius:8px;padding:12px}
  .detail-section h3{margin:0 0 10px;font-size:13px;font-weight:700;color:#334155;border-bottom:1px solid #e6e9f0;padding-bottom:6px}
  .form-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
  .form-group{display:flex;flex-direction:column;gap:3px}
  .form-group label{font-size:11px;font-weight:600;color:#64748b}
  .form-group input,.form-group select,.form-group textarea{border:1px solid #cbd5e1;border-radius:6px;padding:6px 8px;font-size:13px;color:#0f172a;background:#fff;width:100%}
  .form-group textarea{resize:vertical;min-height:54px}
  .so-info{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:10px;font-size:12px;color:#475569;background:#f0f9ff;border:1px solid #bae6fd;border-radius:6px;padding:7px 10px}
  .so-info strong{color:#0f172a}
  .bom-table{width:100%;border-collapse:collapse;font-size:12px}
  .bom-table th,.bom-table td{padding:5px 7px;border-bottom:1px solid #f1f5f9;text-align:left}
  .bom-table th{background:#f8fafc;font-weight:600;color:#475569}
  .bom-ok td{background:#f0fdf4}
  .bom-low td{background:#fffbeb}
  .bom-none td{background:#fef2f2}
  @media(max-width:900px){.detail-grid{grid-template-columns:1fr}}
  .wo-manual td{background:#f4f5f7}
  .delete-btn{border:none;background:none;color:#f87171;font-size:14px;cursor:pointer;padding:2px 4px;border-radius:4px;line-height:1}
  .delete-btn:hover{background:#fee2e2;color:#dc2626}
  .nj-overlay{display:none;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:1000;align-items:center;justify-content:center}
  .nj-overlay.open{display:flex}
  .nj-modal{background:#fff;border-radius:12px;padding:20px 22px;width:100%;max-width:440px;box-shadow:0 8px 32px rgba(0,0,0,.18)}
  .nj-modal h2{margin:0 0 16px;font-size:16px;color:#0f172a;border-bottom:1px solid #e6e9f0;padding-bottom:10px}
  .nj-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px;padding-top:12px;border-top:1px solid #e6e9f0}
  .history-section{margin:0 14px 14px;background:#fff;border:1px solid #e6e9f0;border-radius:8px;padding:0}
  .history-details{width:100%}
  .history-details summary{list-style:none}
  .history-details summary::-webkit-details-marker{display:none}
  .history-heading{display:flex;align-items:center;gap:6px;margin:0;font-size:13px;font-weight:700;color:#334155;padding:10px 12px;cursor:pointer;user-select:none;border-radius:8px}
  .history-heading:hover{background:#f8fafc}
  .history-heading::before{content:'▶';font-size:10px;color:#94a3b8;transition:transform .15s;flex-shrink:0}
  .history-details[open] .history-heading::before{transform:rotate(90deg)}
  .history-count{color:#94a3b8;font-weight:400;font-size:12px}
  .history-body{padding:0 12px 10px;border-top:1px solid #f1f5f9}
  .history-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
  .history-item{display:flex;flex-direction:column;gap:2px;padding:6px 8px;border-radius:6px;background:#f8fafc;border-left:3px solid #cbd5e1;font-size:12px}
  .history-meta{color:#334155}
  .history-changes{color:#64748b;font-size:11px;padding-left:4px}
  .history-empty{margin:0;font-size:12px;color:#94a3b8;font-style:italic}
