* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f4f5f7; color: #222; height: 100vh; overflow: hidden; }

.status { padding: 8px 16px; font-size: 13px; font-weight: 600; color: #fff; }
.status.loading { background: #c60; }
.status.ready { background: #0a7d2c; }
.status.error { background: #c00; }

.app { display: flex; height: calc(100vh - 35px); }

/* SOL */
.left { width: 340px; min-width: 280px; background: #fff; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; }
.search { padding: 12px; border-bottom: 1px solid #eee; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab { flex: 1; padding: 8px; border: none; background: #e8e8e8; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 13px; }
.tab.active { background: #c00; color: #fff; }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; padding: 9px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.search-row button { padding: 9px 16px; background: #c00; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; }
.search-row button:disabled { background: #aaa; cursor: default; }

.engine-info { margin: 10px 12px; padding: 10px; background: #eef6ee; border-radius: 6px; font-size: 13px; line-height: 1.6; }
.engine-info b { color: #0a7d2c; }

.tree { flex: 1; overflow-y: auto; padding: 4px 0; }
.cat { padding: 9px 12px; cursor: pointer; font-weight: 600; font-size: 13px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.cat:hover { background: #f7f7f7; }
.cat .arrow { font-size: 10px; color: #888; transition: transform .15s; }
.cat.open .arrow { transform: rotate(90deg); }
.cat .count { color: #999; font-weight: 400; font-size: 12px; }
.opts { display: none; }
.opts.open { display: block; }
.opt { padding: 7px 12px 7px 28px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f5f5f5; color: #333; }
.opt:hover { background: #fff3f3; }
.opt.active { background: #c00; color: #fff; }

/* SAĞ */
.right { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.diagram { flex: 1; min-height: 200px; background: #fafafa; border-bottom: 1px solid #e0e0e0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.diag-bar { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; background: rgba(255,255,255,.92); border-bottom: 1px solid #eee; min-height: 34px; }
.diag-title { font-weight: 600; font-size: 14px; }
.diag-controls button { width: 30px; height: 28px; margin-left: 4px; border: 1px solid #ccc; background: #fff; border-radius: 4px; cursor: pointer; font-size: 16px; font-weight: 600; line-height: 1; }
.diag-controls button:hover { background: #f0f0f0; }
.viewport { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; }
.viewport.grabbing { cursor: grabbing; }
.viewport img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; user-select: none; -webkit-user-drag: none; }
.empty { color: #999; font-size: 14px; padding: 20px; text-align: center; }

.parts { height: 45%; overflow-y: auto; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f5f5f5; position: sticky; top: 0; font-size: 12px; text-transform: uppercase; color: #666; }
tr:hover td { background: #fafafa; }
.col-item { width: 44px; text-align: center; font-weight: 600; color: #c00; }
.col-pn { font-family: 'Consolas', monospace; font-weight: 600; }
.col-qty { width: 50px; text-align: center; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid #ccc; border-top-color: #c00; border-radius: 50%; animation: s 0.7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
