:root { --b:#111; --g:#666; --bg:#0b0d10; --panel:#11151b; --card:#0f1318; --line:#1e2630; --txt:#e7edf5; }

*{ box-sizing:border-box; }
body{ margin:0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; background:var(--bg); color:var(--txt); }

.topbar{
  display:flex; align-items:flex-end; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--line); background:#0c1016;
  position:sticky; top:0; z-index:10;
}
.brand{ display:flex; gap:12px; align-items:center; }
.logo{ width:36px; height:36px; border-radius:10px; background:#1a2230; display:grid; place-items:center; font-weight:700; }
.title{ font-weight:700; font-size:16px; }
.subtitle{ font-size:12px; color:#9fb0c6; margin-top:2px; }

.controls{ display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; justify-content:flex-end; }
.field{ display:flex; flex-direction:column; gap:6px; font-size:12px; color:#9fb0c6; }
.field input, .note-actions select, textarea{
  background:#0d1219; border:1px solid var(--line); border-radius:10px;
  color:var(--txt); padding:10px 12px; min-width:220px; outline:none;
}
.field input[type="number"]{ min-width:90px; width:90px; }
.btn{
  border:1px solid var(--line); background:#152030; color:var(--txt);
  border-radius:10px; padding:10px 12px; cursor:pointer; font-weight:600;
}
.btn:hover{ filter:brightness(1.08); }
.btn-ghost{ background:transparent; }

.layout{
  display:grid; grid-template-columns: 1fr 520px;
  gap:12px; padding:12px; align-items:start;
}
.panel{
  background:var(--panel); border:1px solid var(--line); border-radius:14px; overflow:hidden;
}
.panel-head{ display:flex; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--line); }
.panel-title{ font-weight:700; }
.muted{ color:#9fb0c6; }
.small{ font-size:12px; }

.table-wrap{ overflow:auto; max-height: calc(100vh - 140px); }
.table{ width:100%; border-collapse:collapse; font-size:13px; }
.table th, .table td{ border-bottom:1px solid #161f2a; padding:10px 10px; vertical-align:top; }
.table th{ color:#9fb0c6; font-weight:600; text-align:left; background:#0f141c; position:sticky; top:0; }
.row{ cursor:pointer; }
.row:hover{ background:#0f1621; }

.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px; border-radius:999px; font-weight:700; font-size:12px;
  border:1px solid var(--line);
}
.badge.ok{ background:#23bf25; }
.badge.attention{ background:#fca800; }
.badge.rescan{ background:#ff0000; }

.drawer{
  background:var(--panel); border:1px solid var(--line); border-radius:14px;
  position:sticky; top:78px; max-height: calc(100vh - 90px); overflow:hidden;
}
.drawer-head{ display:flex; justify-content:space-between; align-items:flex-start;
  padding:12px 14px; border-bottom:1px solid var(--line);
}
.drawer-title{ font-weight:800; font-size:14px; }
.drawer-body{ padding:12px; overflow:auto; max-height: calc(100vh - 150px); }

.card{
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:12px; margin-bottom:12px;
}
.card-title{ font-weight:800; margin-bottom:10px; }

.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.toggle-row{ margin-bottom:10px; }
.toggle{ display:flex; align-items:center; gap:10px; color:#c7d4e6; }
.toggle input{ transform:scale(1.2); }

.pre{
  background:#0b0f14; border:1px solid var(--line); border-radius:12px;
  padding:10px; overflow:auto; font-size:12px; color:#cfe0f7;
}
.notes{ display:flex; flex-direction:column; gap:10px; }
.note{
  border:1px solid #1a2330; border-radius:12px; padding:10px;
  background:#0b0f14;
}
.note-head{ display:flex; justify-content:space-between; margin-bottom:6px; color:#9fb0c6; font-size:12px; }
.note-body{ white-space:pre-wrap; }
.note-compose textarea{ width:100%; min-width:0; margin-top:10px; }
.note-actions{ display:flex; gap:10px; margin-top:10px; justify-content:flex-end; }
.note-actions select{ min-width:160px; }