:root {
  --bg: #f4f6fb;
  --sidebar: #131a2b;
  --sidebar-2: #1c2740;
  --accent: #3b6ef5;
  --accent-dark: #2c55c9;
  --text: #1f2733;
  --muted: #6b7688;
  --border: #e3e8f0;
  --ok: #1f9d55;
  --ok-bg: #e6f6ec;
  --warn: #b7791f;
  --warn-bg: #fdf3e2;
  --err: #d64545;
  --err-bg: #fce8e8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: #cdd6e6;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: 15px;
}
.brand-text { font-weight: 600; font-size: 15px; color: #fff; }
nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #b6c1d6; text-decoration: none; font-size: 14px; cursor: pointer;
}
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #55627d; }
.nav-item.active { background: var(--sidebar-2); color: #fff; }
.nav-item.active .dot { background: var(--accent); }
.nav-item.disabled { color: #5a6479; cursor: default; }
.nav-item small { color: #5a6479; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: #55627d; }

/* Content */
.content { flex: 1; padding: 32px 40px; max-width: 1100px; }
.page-head h1 { margin: 0 0 6px; font-size: 22px; }
.page-head p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(20,30,60,.04);
}

/* Upload */
.upload-card form { display: flex; gap: 18px; align-items: stretch; }
.drop {
  flex: 1; border: 2px dashed #c4cddd; border-radius: 10px;
  padding: 26px; cursor: pointer; transition: .15s; background: #fafbff;
}
.drop.dragover { border-color: var(--accent); background: #eef3ff; }
.drop.has-file { border-color: var(--ok); background: var(--ok-bg); }
.drop-inner { display: flex; align-items: center; gap: 16px; }
.drop-icon {
  width: 46px; height: 46px; border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center;
}
.drop-text { font-size: 14px; color: var(--muted); }
.drop.has-file .drop-text { color: var(--text); font-weight: 600; }

.btn-primary {
  align-self: center; background: var(--accent); color: #fff; border: none;
  padding: 13px 22px; border-radius: 9px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-primary:disabled { background: #aab6cf; cursor: not-allowed; }
.btn-primary.loading { position: relative; color: transparent; }
.btn-primary.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-msg { margin-top: 14px; font-size: 13px; min-height: 18px; }
.status-msg.err { color: var(--err); }
.status-msg.ok { color: var(--ok); }

/* Table */
.table-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.table-head h2 { margin: 0; font-size: 16px; }
.btn-ghost {
  background: #fff; border: 1px solid var(--border); color: var(--muted);
  padding: 7px 14px; border-radius: 7px; font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

table.jobs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.jobs th {
  text-align: left; padding: 10px 12px; color: var(--muted);
  font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap;
}
table.jobs td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.jobs tr:last-child td { border-bottom: none; }
td.empty { text-align: center; color: var(--muted); padding: 26px; }
.file-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.findings-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 11px; padding: 2px 7px; border-radius: 20px;
  background: #eef1f7; color: #4a5568;
}

.pill { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 20px; }
.pill.Completed { background: var(--ok-bg); color: var(--ok); }
.pill.Processing { background: var(--warn-bg); color: var(--warn); }
.pill.Failed { background: var(--err-bg); color: var(--err); }

.an { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.an-full { background: var(--ok-bg); color: var(--ok); }
.an-partial { background: var(--warn-bg); color: var(--warn); }
.an-warn { background: var(--warn-bg); color: var(--warn); }
.an-draft { background: #e8efff; color: var(--accent-dark); }
.an-none { background: #eef1f7; color: #667085; }

.dl-btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 6px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
}
.dl-btn:hover { background: var(--accent-dark); }
.dl-btn.disabled { background: #cbd3e2; pointer-events: none; }
