/* ==========================================================================
   BugKit styles — theme by overriding these vars on :root (or any ancestor):
     --bk-bg  --bk-surface  --bk-border  --bk-text  --bk-dim  --bk-accent
   Everything is namespaced .bk-* / #bk-* so it cannot collide with your app.
   ========================================================================== */
:root {
  --bk-bg: #12151a;
  --bk-surface: #191d24;
  --bk-border: #2b3139;
  --bk-text: #e7ecf3;
  --bk-dim: #8b95a3;
  --bk-accent: #fe3c01;
  --bk-radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bk-bg: #ffffff; --bk-surface: #f6f7f9; --bk-border: #d9dde3;
    --bk-text: #14181d; --bk-dim: #6b7480;
  }
}

/* floating trigger */
.bk-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 2147483000;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 20px; line-height: 1; border: 1px solid var(--bk-border);
  background: var(--bk-surface); color: var(--bk-text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.bk-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .36); }
.bk-fab:active { transform: translateY(0); }

/* modal */
.bk-modal {
  position: fixed; inset: 0; z-index: 2147483100; display: flex;
  align-items: flex-start; justify-content: center; padding: 5vh 16px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px);
  overflow: auto; font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--bk-text);
}
.bk-box {
  width: min(620px, 100%); background: var(--bk-bg);
  border: 1px solid var(--bk-border); border-radius: var(--bk-radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5); overflow: hidden;
}
.bk-h {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--bk-border); font-weight: 700;
  background: var(--bk-surface);
}
.bk-h .bk-x {
  margin-left: auto; background: none; border: 0; color: var(--bk-dim);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.bk-h .bk-x:hover { color: var(--bk-text); }
.bk-body { padding: 14px; }

.bk-fld {
  display: block; margin: 12px 0 5px; font-size: .68rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--bk-dim);
}
.bk-body > .bk-fld:first-child, .bk-body p + .bk-fld { margin-top: 4px; }
.bk-in {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit;
  color: var(--bk-text); background: var(--bk-surface);
  border: 1px solid var(--bk-border); border-radius: 7px; outline: none;
}
.bk-in:focus { border-color: var(--bk-accent); }
.bk-ta { min-height: 110px; resize: vertical; }
.bk-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.bk-row > div { flex: 1 1 130px; }
.bk-foot { margin-top: 14px; align-items: center; }

.bk-btn {
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--bk-text); background: var(--bk-surface);
  border: 1px solid var(--bk-border); border-radius: 7px;
}
.bk-btn:hover { border-color: var(--bk-accent); }
.bk-btn[disabled] { opacity: .5; cursor: default; }
.bk-pri { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }
.bk-sm { padding: 4px 9px; font-size: .78rem; }
.bk-link { color: var(--bk-accent); cursor: pointer; text-decoration: underline; }
.bk-muted { color: var(--bk-dim); font-size: .82rem; }
.bk-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; }
.bk-empty { color: var(--bk-dim); padding: 14px; text-align: center; }
.bk-chip {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--bk-border); font-size: .72rem;
}
.bk-badge {
  display: inline-block; min-width: 17px; margin-left: 6px; padding: 0 5px;
  border-radius: 999px; background: var(--bk-accent); color: #fff;
  font-size: .66rem; font-weight: 700; text-align: center;
}

.bk-auto {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 10px; border: 1px dashed var(--bk-border);
  border-radius: 7px;
}
.bk-auto a { color: var(--bk-accent); }
.bk-prev {
  margin-top: 6px; max-width: 210px; max-height: 130px; display: block;
  border: 1px solid var(--bk-border); border-radius: 5px;
}
.bk-drop {
  margin-top: 12px; padding: 14px; text-align: center; color: var(--bk-dim);
  border: 1px dashed var(--bk-border); border-radius: 7px; font-size: .84rem;
}
.bk-drop.over { border-color: var(--bk-accent); color: var(--bk-text); }
.bk-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.bk-thumb { position: relative; width: 92px; height: 66px; }
.bk-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  border: 1px solid var(--bk-border); border-radius: 6px;
}
.bk-thumb button {
  position: absolute; top: -6px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 1px solid var(--bk-border); cursor: pointer;
  background: var(--bk-bg); color: var(--bk-text); font-size: 12px; line-height: 1;
}
.bk-tb-x { right: -6px; }
.bk-tb-a { right: 18px; }

/* annotator */
.bk-annot {
  position: fixed; inset: 0; z-index: 2147483200; display: flex;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, .82);
  font: 13px system-ui, sans-serif; color: var(--bk-text);
}
.bk-annot-box { max-width: 96vw; max-height: 94vh; }
.bk-annot-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 8px; background: var(--bk-surface);
  border: 1px solid var(--bk-border); border-radius: 8px;
}
.bk-annot-bar button {
  padding: 4px 10px; font: inherit; cursor: pointer; border-radius: 6px;
  border: 1px solid var(--bk-border); background: var(--bk-bg); color: var(--bk-text);
}
.bk-annot-bar button.on { border-color: var(--bk-accent); color: var(--bk-accent); }
.bk-annot-bar button.pri { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }
.bk-annot-bar .bk-col { width: 22px; height: 22px; padding: 0; border-radius: 50%; }
.bk-annot-bar .bk-col.on { outline: 2px solid var(--bk-text); outline-offset: 1px; }
.bk-sep { width: 1px; height: 20px; background: var(--bk-border); }
.bk-annot-canvas { overflow: auto; max-height: 80vh; }
.bk-annot-canvas canvas { display: block; cursor: crosshair; border-radius: 6px; }

/* tables (my reports + admin inbox) */
.bk-tbl { width: 100%; border-collapse: collapse; font-size: .8rem; }
.bk-tbl th, .bk-tbl td {
  padding: 6px 9px; text-align: left; border-bottom: 1px solid var(--bk-border);
  vertical-align: middle;
}
.bk-tbl th {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--bk-dim); font-weight: 600;
}
.bk-tbl tr:last-child td { border-bottom: none; }
.bk-gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.bk-gallery img {
  max-width: 260px; max-height: 190px; border: 1px solid var(--bk-border);
  border-radius: 6px;
}
.bk-console {
  max-height: 300px; overflow: auto; padding: 9px 10px; margin: 0;
  background: var(--bk-surface); border: 1px solid var(--bk-border);
  border-radius: 7px; font: .72rem/1.5 ui-monospace, Menlo, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.bk-console .lvl-error, .bk-console .lvl-uncaught, .bk-console .lvl-rejection { color: #ff6b6b; }
.bk-console .lvl-warn { color: #ffb224; }
.bk-console .lvl-log, .bk-console .lvl-info, .bk-console .lvl-debug { color: var(--bk-dim); }

/* screenshot library grid */
.bk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.bk-card {
  border: 1px solid var(--bk-border); border-radius: 9px; padding: 8px;
  background: var(--bk-surface);
}
.bk-card-thumb {
  height: 118px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 6px; background: var(--bk-bg);
}
.bk-card-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bk-pdf {
  display: flex; align-items: center; justify-content: center; width: 100%;
  height: 100%; color: var(--bk-dim); font: 700 .8rem system-ui, sans-serif;
}
.bk-card-fn {
  margin-top: 6px; font-size: .76rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.bk-card-acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.bk-card-acts .bk-btn { padding: 3px 7px; font-size: .7rem; }

@media (max-width: 640px) {
  .bk-modal { padding: 0; }
  .bk-box { width: 100%; min-height: 100%; border-radius: 0; }
  .bk-fab { right: 12px; bottom: 12px; }
}
