/* ============================================================
   Biznify Issue Tracker

   Stance: an engineering review dossier — dense, precise and
   calm, so a dev lead can triage 54 findings without losing
   their place. One grotesque sans, a tight scale with one very
   large number for contrast, tabular numerals, hairline borders
   instead of shadows, and a single functional accent.

   Bengali sits beside English rather than replacing it, so the
   type stack carries a dedicated Bengali family with its own
   line height.
   ============================================================ */

:root {
  /* ---- colour: semantic roles ---- */
  --bg:            #f6f6f4;
  --surface:       #ffffff;
  --surface-sunk:  #f2f2ef;
  --border:        #e2e2dd;
  --border-strong: #c6c6bf;
  --text:          #14171a;
  --text-muted:    #545a60;
  --text-faint:    #80868c;
  --accent:        #0b7268;
  --accent-hover:  #095e56;
  --accent-text:   #ffffff;
  --accent-weak:   #e4f1ef;
  --accent-line:   #9dcbc4;

  --brand-navy:    #174f7d;

  --critical:      #a3201a;
  --critical-weak: #fbeae8;
  --high:          #8a4b06;
  --high-weak:     #fbf1e3;
  --medium:        #21548d;
  --medium-weak:   #e9f0f8;
  --low:           #5b6166;
  --low-weak:      #ecedec;

  --open:          #6b7076;
  --progress:      #8a5d00;
  --fixed:         #0b7268;
  --verified:      #146640;
  --wontfix:       #878d93;

  /* ---- type ---- */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, sans-serif;
  --font-bn:   "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI",
               "Shonar Bangla", "Kalpurush", var(--font-body);
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --text-xs:   0.75rem;     /* 12 — micro labels */
  --text-sm:   0.8125rem;   /* 13 — UI, meta */
  --text-base: 0.9375rem;   /* 15 — list titles, controls */
  --text-md:   1.0625rem;   /* 17 — reading copy */
  --text-lg:   1.375rem;    /* 22 — panel-level headings */
  --text-xl:   1.875rem;    /* 30 — issue title */
  --text-2xl:  3.25rem;     /* 52 — the one big number */

  --leading-tight: 1.16;
  --leading-snug:  1.4;
  --leading-body:  1.62;
  --leading-bn:    1.8;

  /* ---- space: 4px base ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: 3px;
  --radius:    5px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  --shadow-2: 0 4px 14px rgb(0 0 0 / 0.10);
  --shadow-3: 0 18px 44px rgb(0 0 0 / 0.18);

  --container: 1360px;
  --measure: 72ch;
  --topbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0d0f11;
    --surface:       #15181b;
    --surface-sunk:  #0f1215;
    --border:        #262b30;
    --border-strong: #3b4147;
    --text:          #eef0f2;
    --text-muted:    #a4aab0;
    --text-faint:    #737a81;
    --accent:        #4ecdbd;
    --accent-hover:  #6ddbcd;
    --accent-text:   #06201d;
    --accent-weak:   #0f2b28;
    --accent-line:   #2a6b64;
    --brand-navy:    #dbe6f2;

    --critical:      #f2837a;
    --critical-weak: #2c1613;
    --high:          #e0a355;
    --high-weak:     #2a2012;
    --medium:        #7aabe0;
    --medium-weak:   #14202c;
    --low:           #9aa1a8;
    --low-weak:      #1a1e21;

    --open:          #99a1a8;
    --progress:      #e0a355;
    --fixed:         #4ecdbd;
    --verified:      #59c98c;
    --wontfix:       #7d858c;

    --shadow-2: 0 4px 14px rgb(0 0 0 / 0.55);
    --shadow-3: 0 18px 44px rgb(0 0 0 / 0.7);
  }
}

:root[data-theme="dark"] {
  --bg:            #0d0f11;
  --surface:       #15181b;
  --surface-sunk:  #0f1215;
  --border:        #262b30;
  --border-strong: #3b4147;
  --text:          #eef0f2;
  --text-muted:    #a4aab0;
  --text-faint:    #737a81;
  --accent:        #4ecdbd;
  --accent-hover:  #6ddbcd;
  --accent-text:   #06201d;
  --accent-weak:   #0f2b28;
  --accent-line:   #2a6b64;
  --brand-navy:    #dbe6f2;
  --critical:      #f2837a;
  --critical-weak: #2c1613;
  --high:          #e0a355;
  --high-weak:     #2a2012;
  --medium:        #7aabe0;
  --medium-weak:   #14202c;
  --low:           #9aa1a8;
  --low-weak:      #1a1e21;
  --open:          #99a1a8;
  --progress:      #e0a355;
  --fixed:         #4ecdbd;
  --verified:      #59c98c;
  --wontfix:       #7d858c;
  --shadow-2: 0 4px 14px rgb(0 0 0 / 0.55);
  --shadow-3: 0 18px 44px rgb(0 0 0 / 0.7);
}

/* ---------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--text-base)/var(--leading-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: var(--leading-tight); font-weight: 640; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Bengali needs more vertical room and its own family, wherever it
   appears — including inside an otherwise English page. */
[lang="bn"] { font-family: var(--font-bn); line-height: var(--leading-bn); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; }

.micro {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 660;
  color: var(--text-faint);
}
.micro[lang="bn"] { letter-spacing: 0; text-transform: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.logo-wordmark { display: block; flex: none; }

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 34px; padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm); font-weight: 560; line-height: var(--leading-snug);
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color 130ms ease-out, border-color 130ms ease-out,
              color 130ms ease-out;
}
.btn:hover { background: var(--surface-sunk); border-color: var(--text-faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--border-strong); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-sunk); border-color: transparent; color: var(--text); }

.btn-sm { min-height: 30px; padding: 0 var(--space-2); font-size: var(--text-xs); }
.btn.is-disabled { opacity: 0.35; pointer-events: none; }

.icon {
  width: 16px; height: 16px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* A cluster of related controls reads as one object, not four. */
.toolgroup {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.toolgroup > * { border: 0; border-radius: 0; min-height: 32px; }
.toolgroup > * + * { border-left: 1px solid var(--border); }
.toolgroup .btn:hover { background: var(--surface-sunk); border-color: transparent; }

/* Segmented control — the language switch */
.seg { display: inline-flex; }
.seg button {
  padding: 0 var(--space-3); min-height: 32px;
  background: transparent; border: 0; cursor: pointer;
  font-size: var(--text-xs); font-weight: 620; color: var(--text-muted);
  transition: background-color 130ms ease-out, color 130ms ease-out;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface-sunk); color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* ---------------------------------------------------------- inputs */

.input {
  width: 100%; min-height: 38px; padding: var(--space-2) var(--space-3);
  background: var(--surface-sunk);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 130ms ease-out, background-color 130ms ease-out,
              box-shadow 130ms ease-out;
}
.input:hover { border-color: var(--text-faint); }
.input:focus {
  background: var(--surface); border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.input::placeholder { color: var(--text-faint); }
select.input { padding-block: 0; cursor: pointer; }
textarea.input { min-height: 88px; resize: vertical; line-height: var(--leading-body); }

.field { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-5); }
.field label { font-size: var(--text-sm); font-weight: 620; }
.field .hint { font-size: var(--text-xs); color: var(--text-faint); }

/* ---------------------------------------------------------- login */

.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: var(--space-6);
  background:
    radial-gradient(70ch 45ch at 50% -15%, var(--accent-weak), transparent 70%),
    var(--bg);
}

/* Two halves: what this is on the left, the way in on the right. */
.login-shell {
  width: min(960px, 100%);
  display: grid; grid-template-columns: 1fr;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
@media (min-width: 880px) {
  .login-shell { grid-template-columns: 1.05fr 0.95fr; }
}

/* A deliberately dark cover panel — the same in both themes, so the page
   has a spine instead of being a card floating on an empty field. */
.login-aside {
  --brand-navy: #ffffff;                    /* the wordmark reads white here */
  /* One fixed colour in both themes: dark enough to carry white type on a
     light page, light enough to separate from the page on a dark one. */
  background:
    radial-gradient(40ch 30ch at 8% 0%, rgb(78 205 189 / 0.16), transparent 70%),
    #10222a;
  color: #dde7e9;
  padding: var(--space-10) var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-8);
}
.login-aside .logo-wordmark { width: 118px; height: 42px; }
.login-intro { display: flex; flex-direction: column; gap: var(--space-3); }
.login-aside h1 { font-size: var(--text-lg); color: #ffffff; letter-spacing: -0.015em; }
.login-aside .lead { display: flex; flex-direction: column; gap: var(--space-3);
                     font-size: var(--text-sm); line-height: var(--leading-body);
                     color: #a9bcc0; max-width: 46ch; }
.login-aside .lead .lead-bn {
  padding-left: var(--space-3); border-left: 2px solid rgb(78 205 189 / 0.45);
  color: #96abaf;
}

.login-points { list-style: none; margin: 0; padding: 0;
                display: flex; flex-direction: column; gap: var(--space-4);
                margin-top: auto; }
.login-points li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; }
.login-points .icon { width: 15px; height: 15px; color: #4ecdbd; margin-top: 3px; }
.login-points strong { display: block; font-size: var(--text-sm); font-weight: 620; color: #eef4f5; }
.login-points span { display: block; font-size: var(--text-xs); color: #93a7ab; line-height: var(--leading-snug); }
.login-points span[lang="bn"] { line-height: var(--leading-bn); }

.login-foot { font-size: var(--text-xs); color: #6f8388;
              padding-top: var(--space-5); border-top: 1px solid rgb(255 255 255 / 0.10); }

.login-panel { padding: var(--space-8); display: flex; flex-direction: column; }
.login-card { display: contents; }        /* the form adds no box of its own */
.login-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding-bottom: var(--space-5); border-bottom: 1px solid var(--border);
}
.login-card-head h2 { font-size: var(--text-md); }
.login-panel .field:first-of-type { margin-top: var(--space-6); }

.notice {
  margin-top: var(--space-6); padding: var(--space-3) var(--space-4);
  background: var(--accent-weak); border-left: 3px solid var(--accent);
  border-radius: var(--radius); font-size: var(--text-sm);
  line-height: var(--leading-body); color: var(--text);
}

/* Reveal control shared by every password field. */
.peek-wrap { position: relative; }
.peek-wrap .input { padding-right: 44px; }
.peek {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius);
  color: var(--text-faint); cursor: pointer;
  transition: color 130ms ease-out, background-color 130ms ease-out;
}
.peek:hover { color: var(--text); background: var(--surface); }

.btn-lg { min-height: 44px; font-size: var(--text-base); width: 100%; }

.login-lang {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-8); padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.login-lang .micro { margin-right: auto; }

@media (max-width: 560px) {
  .login-wrap { padding: 0; place-items: stretch; }
  .login-shell { border: 0; border-radius: 0; min-height: 100dvh; align-content: start; }
  .login-aside { padding: var(--space-6) var(--space-5); gap: var(--space-5); }
  .login-points { margin-top: 0; }
  .login-panel { padding: var(--space-6) var(--space-5) var(--space-10); }
}

/* ------------------------------------------------------- page headers */

.page-head {
  display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.page-head h2 { font-size: var(--text-lg); letter-spacing: -0.015em; }
.page-head .sub { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }
.page-head .sub[lang="bn"] { line-height: var(--leading-bn); }
.page-head .actions { margin-left: auto; display: flex; gap: var(--space-2); }

.page-narrow { max-width: 560px; }

/* ------------------------------------------------------------- users */

.table-wrap { overflow-x: auto; border: 1px solid var(--border);
              border-radius: var(--radius-lg); background: var(--surface); }
table.grid { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.grid th, table.grid td {
  text-align: left; padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
table.grid thead th {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); font-weight: 680; background: var(--surface-sunk);
  white-space: nowrap;
}
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: var(--surface-sunk); }
table.grid td.right { text-align: right; white-space: nowrap; }
table.grid .u-name { font-weight: 620; display: block; }
table.grid .u-mail { color: var(--text-muted); font-size: var(--text-xs);
                     font-family: var(--font-mono); }
table.grid .u-when { color: var(--text-faint); font-size: var(--text-xs);
                     font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr[data-inactive="true"] td { opacity: 0.55; }

.role-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 650; white-space: nowrap;
  border: 1px solid currentColor;
}
.r-admin  { color: var(--critical); }
.r-dev    { color: var(--accent); }
.r-viewer { color: var(--text-muted); }

.row-actions { display: inline-flex; gap: var(--space-1); }
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: color 130ms ease-out, border-color 130ms ease-out, background-color 130ms ease-out;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-faint); background: var(--surface-sunk); }
.icon-btn.danger:hover { color: var(--critical); border-color: var(--critical); }
.icon-btn .icon { width: 15px; height: 15px; }

.form-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .field { margin-top: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }

.gen-row { display: flex; gap: var(--space-2); align-items: center; }
.gen-row .input { flex: 1; }

.form-error {
  margin-top: var(--space-4); padding: var(--space-3);
  background: var(--critical-weak); border: 1px solid var(--critical);
  border-radius: var(--radius); color: var(--critical);
  font-size: var(--text-sm); display: flex; gap: var(--space-2); align-items: flex-start;
}

/* ---------------------------------------------------------- shell */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--container); margin-inline: auto;
  min-height: var(--topbar-h);
  padding: var(--space-2) var(--space-5);
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: var(--space-3); margin-right: auto; min-width: 0; }
.brand .logo-wordmark { width: 92px; height: 33px; flex: none; }
.brand-sep { width: 1px; align-self: stretch; min-height: 26px; background: var(--border); flex: none; }
.brand-text h1 { font-size: var(--text-base); letter-spacing: -0.01em; }
.brand-text p { font-size: var(--text-xs); color: var(--text-faint); margin-top: 1px; }

.who {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: var(--text-sm); color: var(--text-muted);
}
.who-badge {
  padding: 2px var(--space-2); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-text);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
}
.who-badge.is-view { background: var(--surface-sunk); color: var(--text-muted); }

main {
  max-width: var(--container); margin-inline: auto;
  padding: var(--space-8) var(--space-5) var(--space-16);
}

/* ---------------------------------------------------- overview card */

/* One card, two halves: how far the work has got on the left, what is
   still burning on the right. Both halves are filters. */
.overview {
  display: grid; gap: 0; grid-template-columns: 1fr;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: var(--space-6);
}
@media (min-width: 900px) {
  .overview { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); }
  .ov-right { border-left: 1px solid var(--border); border-top: 0; }
}

.ov-left  { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.ov-right { padding: var(--space-6); border-top: 1px solid var(--border);
            display: flex; flex-direction: column; gap: var(--space-4);
            background: var(--surface-sunk); }

.ov-figure { display: flex; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; }
.ov-pct {
  font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.035em;
  line-height: 0.9; font-variant-numeric: tabular-nums;
}
.ov-cap { font-size: var(--text-sm); color: var(--text-muted); }

.bar {
  display: flex; height: 8px; border-radius: var(--radius-pill);
  overflow: hidden; background: var(--surface-sunk);
  border: 1px solid var(--border);
}
.bar span { display: block; transition: width 320ms ease-out; }
.bar .s-verified   { background: var(--verified); }
.bar .s-fixed      { background: var(--fixed); }
.bar .s-in_progress{ background: var(--progress); }
.bar .s-wont_fix   { background: var(--border-strong); }

/* Status filters — a row of chips, not six competing boxes. */
.legend { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); cursor: pointer;
  font-size: var(--text-sm); color: var(--text-muted);
  transition: border-color 130ms ease-out, background-color 130ms ease-out, color 130ms ease-out;
}
.chip:hover { border-color: var(--text-faint); color: var(--text); }
.chip[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-weak); color: var(--text);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* Severity rail — proportional bars, so the shape of the backlog is
   visible before a single row is read. */
.sev-rail { display: flex; flex-direction: column; gap: var(--space-2); }
.sev-row {
  display: grid; grid-template-columns: 5.5rem 1fr 2.2rem; align-items: center;
  gap: var(--space-3); width: 100%;
  background: none; border: 0; padding: var(--space-1) 0; cursor: pointer;
  text-align: left; border-radius: var(--radius);
  transition: opacity 130ms ease-out;
}
.sev-row:hover { opacity: 0.75; }
.sev-row .k { font-size: var(--text-xs); font-weight: 660; }
.sev-row .track { height: 6px; border-radius: var(--radius-pill); background: var(--border); overflow: hidden; }
.sev-row .fill { display: block; height: 100%; border-radius: var(--radius-pill); transition: width 320ms ease-out; }
.sev-row .n { font-size: var(--text-sm); font-weight: 680; font-variant-numeric: tabular-nums; text-align: right; }
.sev-row[aria-pressed="true"] .k { text-decoration: underline; text-underline-offset: 3px; }

.k-critical { color: var(--critical); } .f-critical { background: var(--critical); }
.k-high     { color: var(--high); }     .f-high     { background: var(--high); }
.k-medium   { color: var(--medium); }   .f-medium   { background: var(--medium); }
.k-low      { color: var(--low); }      .f-low      { background: var(--low); }

/* ---------------------------------------------------------- filters */

.filters {
  display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center;
  margin-bottom: var(--space-4);
}
.search-wrap { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-wrap .icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.search-wrap .input { padding-left: 36px; min-height: 38px; }
.filters select.input { flex: 0 1 170px; min-height: 38px; }
.filters .count { margin-left: auto; font-size: var(--text-xs); color: var(--text-faint);
                  font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- list */

.list { display: flex; flex-direction: column; gap: var(--space-6); }

.group { border: 1px solid var(--border); border-radius: var(--radius-lg);
         overflow: hidden; background: var(--surface); }
.group-head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunk); border-bottom: 1px solid var(--border);
}
.group-head .swatch { width: 3px; height: 14px; border-radius: 2px; flex: none; }
.group-head .name { font-size: var(--text-xs); font-weight: 700;
                    letter-spacing: 0.07em; text-transform: uppercase; }
.group-head .name[lang="bn"] { letter-spacing: 0; text-transform: none; }
.group-head .n { margin-left: auto; font-size: var(--text-xs); color: var(--text-faint);
                 font-variant-numeric: tabular-nums; }

.row {
  display: grid; gap: var(--space-1) var(--space-4); width: 100%; text-align: left;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: start;
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-3);
  background: var(--surface); border: 0; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background-color 130ms ease-out;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-sunk); }
.row[data-sev="critical"] { border-left-color: var(--critical); }
.row[data-sev="high"]     { border-left-color: var(--high); }
.row[data-sev="medium"]   { border-left-color: var(--medium); }
.row[data-sev="low"]      { border-left-color: var(--border-strong); }
.row[data-done="true"]    { background: var(--surface-sunk); }
.row[data-done="true"] .row-title { color: var(--text-muted); }

.row-ref {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  color: var(--text-faint); padding-top: 3px; letter-spacing: -0.02em;
}
.row-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.row-title {
  font-size: var(--text-base); font-weight: 600; line-height: var(--leading-snug);
  letter-spacing: -0.005em;
}
.row-title-bn {
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted);
  line-height: var(--leading-bn); font-family: var(--font-bn);
  padding-left: var(--space-3); border-left: 2px solid var(--border);
}
.row-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }

/* ---------------------------------------------------------- tags */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 620; line-height: 1.55; white-space: nowrap;
}
.tag-crit   { background: var(--critical-weak); color: var(--critical); }
.tag-high   { background: var(--high-weak);     color: var(--high); }
.tag-med    { background: var(--medium-weak);   color: var(--medium); }
.tag-low    { background: var(--low-weak);      color: var(--low); }
.tag-plain  { background: var(--surface-sunk);  color: var(--text-muted); }
.tag-mod    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 650; white-space: nowrap;
  border: 1px solid currentColor;
}
.st-open        { color: var(--open); }
.st-in_progress { color: var(--progress); }
.st-fixed       { color: var(--fixed); }
.st-verified    { color: var(--verified); }
.st-wont_fix    { color: var(--wontfix); }
.status-chip .icon { width: 13px; height: 13px; }

.comment-count, .shot-count {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); color: var(--text-faint);
}
.comment-count .icon, .shot-count .icon { width: 13px; height: 13px; }

/* ------------------------------------------------- empty / loading */

.empty { padding: var(--space-16) var(--space-6); text-align: center; color: var(--text-muted);
         border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.empty .icon { width: 30px; height: 30px; color: var(--text-faint); margin-bottom: var(--space-3); }
.empty h3 { font-size: var(--text-md); margin-bottom: var(--space-2); }
.empty p { font-size: var(--text-sm); }

.skeleton { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3);
            border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.skeleton div { height: 52px; border-radius: var(--radius); background: var(--surface-sunk);
                animation: pulse 1.4s ease-in-out infinite; }
.skeleton div:nth-child(2) { animation-delay: 0.1s; }
.skeleton div:nth-child(3) { animation-delay: 0.2s; }
.skeleton div:nth-child(4) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ------------------------------------------------------ issue page */

.issue-nav {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-5); flex-wrap: wrap;
}
.issue-nav .spacer { flex: 1; }
.issue-pos { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-faint); }

/* The hero is the one big element: severity paints its edge, the title
   is far larger than anything around it. */
.issue-hero {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: var(--space-8) var(--space-8) 0;
  display: flex; flex-direction: column; gap: var(--space-4);
  overflow: hidden;
}
.issue-hero[data-sev="critical"] { border-left-color: var(--critical); }
.issue-hero[data-sev="high"]     { border-left-color: var(--high); }
.issue-hero[data-sev="medium"]   { border-left-color: var(--medium); }
.issue-hero[data-sev="low"]      { border-left-color: var(--border-strong); }

.issue-hero-top { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.issue-ref {
  font-family: var(--font-mono); font-size: var(--text-base); font-weight: 700;
  letter-spacing: 0.02em; color: var(--text-muted);
  padding: 3px var(--space-2); background: var(--surface-sunk);
  border-radius: var(--radius-sm);
}
.issue-title {
  font-size: var(--text-xl); line-height: 1.2; letter-spacing: -0.022em;
  max-width: 34ch; font-weight: 660;
}
.issue-title-bn {
  font-family: var(--font-bn); font-size: var(--text-md); font-weight: 550;
  line-height: var(--leading-bn); color: var(--text-muted); max-width: 44ch;
  padding-left: var(--space-4); border-left: 2px solid var(--accent-line);
}
.issue-tags { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.issue-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-4) var(--space-6);
  margin: var(--space-2) calc(var(--space-8) * -1) 0;
  padding: var(--space-4) var(--space-8);
  border-top: 1px solid var(--border); background: var(--surface-sunk);
}
.fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact .k {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-faint); font-weight: 650;
}
.fact .k[lang="bn"] { text-transform: none; letter-spacing: 0; }
.fact .v { font-size: var(--text-sm); color: var(--text); font-weight: 560;
           overflow: hidden; text-overflow: ellipsis; }
.fact .v.mono { font-family: var(--font-mono); font-weight: 500; }

.issue-grid {
  display: grid; gap: var(--space-4); grid-template-columns: 1fr;
  align-items: start; margin-top: var(--space-4);
}
@media (min-width: 1040px) {
  .issue-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 330px); }
  .issue-side { position: sticky; top: calc(var(--topbar-h) + var(--space-4)); }
}
.issue-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.issue-side { display: flex; flex-direction: column; gap: var(--space-4); }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.panel > h3 {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint); font-weight: 680;
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--border);
}
.panel > h3 .icon { width: 14px; height: 14px; }
.panel > h3 .alt {
  font-family: var(--font-bn); text-transform: none; letter-spacing: 0;
  font-weight: 550; opacity: 0.85;
}
.panel > h3 .alt::before { content: "/"; margin-right: 0.4em; opacity: 0.5; }
.panel > h3 .n { margin-left: auto; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.issue-side .panel { padding: var(--space-5); }

.prose { font-size: var(--text-md); line-height: var(--leading-body);
         max-width: var(--measure); color: var(--text); }
.prose p + p { margin-top: var(--space-4); }

/* The Bengali reading of the same text, set apart but not demoted. */
.dual {
  margin-top: var(--space-5); padding-top: var(--space-5);
  border-top: 1px dashed var(--border-strong);
}
.lang-mark {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: var(--space-3);
}
.prose[lang="bn"] { font-family: var(--font-bn); font-size: var(--text-base);
                    line-height: var(--leading-bn); max-width: 68ch; }

.callout {
  padding: var(--space-4); border-radius: var(--radius);
  background: var(--surface-sunk); border-left: 3px solid var(--border-strong);
  font-size: var(--text-sm);
}
.callout.evidence {
  font-family: var(--font-mono); font-size: var(--text-xs);
  line-height: 1.6; word-break: break-word; color: var(--text-muted);
}
.callout.suggest {
  border-left-color: var(--accent); background: var(--accent-weak);
  font-size: var(--text-base); line-height: var(--leading-body);
}
.callout.suggest[lang="bn"] { font-family: var(--font-bn); line-height: var(--leading-bn); }
.callout + .callout { margin-top: var(--space-3); }

/* -------------------------------------------------- status picker */

.status-picker { display: flex; flex-direction: column; gap: var(--space-2); }
.status-btn {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  font-size: var(--text-sm); font-weight: 580; cursor: pointer; text-align: left;
  transition: background-color 130ms ease-out, border-color 130ms ease-out, color 130ms ease-out;
}
.status-btn .icon { width: 15px; height: 15px; }
.status-btn:hover:not(:disabled) { border-color: var(--text-faint); background: var(--surface-sunk); }
.status-btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
}
.status-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.readonly-note {
  display: flex; gap: var(--space-2); align-items: flex-start;
  padding: var(--space-3); border-radius: var(--radius);
  background: var(--surface-sunk); border: 1px dashed var(--border-strong);
  font-size: var(--text-xs); color: var(--text-muted); line-height: var(--leading-snug);
}

/* ------------------------------------------------------ screenshots */

.shots { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.shot {
  margin: 0;                        /* figure carries a 40px UA margin */
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-sunk); min-width: 0;
  transition: border-color 130ms ease-out;
}
.shot:hover { border-color: var(--text-faint); }
.shot button.shot-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot img { display: block; width: 100%; height: 145px; object-fit: cover; background: #fff; }
.shot figcaption {
  padding: var(--space-2) var(--space-3); font-size: var(--text-xs);
  color: var(--text-muted); border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.shot figcaption .name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.shot figcaption .who {
  color: var(--text-faint); font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot .shot-del {
  position: absolute; top: var(--space-2); right: var(--space-2);
  width: 27px; height: 27px; display: grid; place-items: center;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--critical); cursor: pointer;
  opacity: 0; transition: opacity 140ms ease-out;
}
.shot:hover .shot-del, .shot .shot-del:focus-visible { opacity: 1; }
.shot .shot-del .icon { width: 14px; height: 14px; }

.dropzone {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: var(--space-6); text-align: center; color: var(--text-muted);
  font-size: var(--text-sm); background: var(--surface-sunk);
  transition: border-color 140ms ease-out, background-color 140ms ease-out, color 140ms ease-out;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.dropzone .icon { width: 22px; height: 22px; display: block; margin: 0 auto var(--space-2); }
.dropzone .pick {
  color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; background: none; border: 0; font: inherit; padding: 0;
}
.dropzone .sub { display: block; margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-faint); }

/* ------------------------------------------------------- notes / log */

.thread { display: flex; flex-direction: column; gap: var(--space-3); }
.note {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); background: var(--surface-sunk);
}
.note-head { display: flex; gap: var(--space-2); align-items: baseline; margin-bottom: var(--space-2); }
.note-author { font-size: var(--text-sm); font-weight: 650; }
.note-time { font-size: var(--text-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.note-body { font-size: var(--text-sm); white-space: pre-wrap; word-break: break-word;
             line-height: var(--leading-body); }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.log li { font-size: var(--text-xs); color: var(--text-muted); display: flex;
          flex-direction: column; gap: 2px; padding-left: var(--space-3);
          border-left: 2px solid var(--border); }
.log time { color: var(--text-faint); font-variant-numeric: tabular-nums; }

.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.row-inline { display: flex; gap: var(--space-2); }
.self-start { align-self: flex-start; }
.muted-sm { color: var(--text-faint); font-size: var(--text-sm); }

/* ------------------------------------------------------- lightbox */

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid;
  grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--space-3); padding: var(--space-4);
  background: rgb(8 10 12 / 0.88);
}
.lightbox[hidden] { display: none; }
.lb-figure { display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
             min-width: 0; max-height: 100%; margin: 0; }
.lb-figure img {
  max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain;
  border-radius: var(--radius); background: #fff;
}
.lb-figure figcaption { color: #e9eaec; font-size: var(--text-sm); text-align: center; max-width: 70ch; }
.lb-close, .lb-nav {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  border-radius: var(--radius); border: 1px solid rgb(255 255 255 / 0.28);
  background: rgb(255 255 255 / 0.10); color: #fff;
  transition: background-color 130ms ease-out;
}
.lb-close:hover, .lb-nav:hover { background: rgb(255 255 255 / 0.22); }
.lb-close { position: absolute; top: var(--space-4); right: var(--space-4); }
.lb-nav[disabled] { opacity: 0.3; cursor: default; }

/* ---------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%);
  z-index: 80; padding: var(--space-3) var(--space-5);
  background: var(--text); color: var(--bg);
  border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 570;
  box-shadow: var(--shadow-3);
}

/* ------------------------------------------------------ responsive */

@media (max-width: 720px) {
  main { padding: var(--space-5) var(--space-4) var(--space-12); }
  .ov-left, .ov-right { padding: var(--space-5); }
  .issue-hero { padding: var(--space-5) var(--space-5) 0; }
  .issue-facts { margin-inline: calc(var(--space-5) * -1); padding-inline: var(--space-5); }
  .panel { padding: var(--space-5); }
  .issue-title { font-size: var(--text-lg); max-width: none; }
}

@media (max-width: 560px) {
  .row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .row-ref { padding-top: 0; }
  .row-right { flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--space-3); }
  .topbar-inner { gap: var(--space-2); padding-inline: var(--space-4); }
  .brand { width: 100%; margin-right: 0; }
  .who { display: none; }
  .filters .count { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
