/* ============================================================
   QA TEST MANAGEMENT & BUG TRACKING — DESIGN SYSTEM
   Signature idea: status/severity color is the app's real content,
   so the "rail" (sidebar accent + card left-borders + badges) always
   carries live status meaning instead of being decorative.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root{
  /* ---- Base palette (light) ---- */
  --bg: #F1F3F6;
  --surface: #FFFFFF;
  --surface-alt: #F7F8FA;
  --border: #E3E7ED;
  --text: #1A2130;
  --text-dim: #626C7E;
  --text-faint: #9AA3B2;

  /* ---- Signal (primary) ---- */
  --primary: #3949AB;
  --primary-dark: #2C3789;
  --primary-soft: #E9EBFB;

  /* ---- Status (Test Case) ---- */
  --status-passed: #1E9E6B;
  --status-passed-bg: #E4F7EE;
  --status-failed: #D64550;
  --status-failed-bg: #FCE9EA;
  --status-blocked: #D98A2B;
  --status-blocked-bg: #FCF1E1;
  --status-notrun: #8A93A6;
  --status-notrun-bg: #EEF0F4;
  --status-retest: #7B5FCB;
  --status-retest-bg: #EFEAFB;

  /* ---- Severity (Bug) ---- */
  --sev-critical: #B0203A;
  --sev-critical-bg: #FBE3E7;
  --sev-high: #D64550;
  --sev-high-bg: #FCE9EA;
  --sev-medium: #D98A2B;
  --sev-medium-bg: #FCF1E1;
  --sev-low: #4E88C7;
  --sev-low-bg: #E9F1FB;

  /* ---- Bug status ---- */
  --bug-open: #D64550;
  --bug-assigned: #D98A2B;
  --bug-inprogress: #4E88C7;
  --bug-readytotest: #7B5FCB;
  --bug-reopened: #B0203A;
  --bug-closed: #1E9E6B;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --shadow-s: 0 1px 2px rgba(20,24,35,.05), 0 1px 1px rgba(20,24,35,.04);
  --shadow-m: 0 4px 14px rgba(20,24,35,.08);
  --shadow-l: 0 12px 32px rgba(20,24,35,.14);
  --font-ui: Arial, Helvetica, sans-serif;
  --font-id: Arial, Helvetica, sans-serif;
  --sidebar-w: 248px;
  --header-h: 64px;
}

[data-theme="dark"]{
  --bg: #10131C;
  --surface: #181C27;
  --surface-alt: #1D2230;
  --border: #2A3040;
  --text: #E7EAF2;
  --text-dim: #A2AAC0;
  --text-faint: #6B7386;

  --primary: #6C7FEF;
  --primary-dark: #5567D8;
  --primary-soft: #232B4A;

  --status-passed: #3FCB8C;
  --status-passed-bg: #113526;
  --status-failed: #F17179;
  --status-failed-bg: #3A1D22;
  --status-blocked: #EDAD57;
  --status-blocked-bg: #3B2A16;
  --status-notrun: #909AB2;
  --status-notrun-bg: #232838;
  --status-retest: #A78CE0;
  --status-retest-bg: #2B2440;

  --sev-critical: #F6748A;
  --sev-critical-bg: #3B1B26;
  --sev-high: #F17179;
  --sev-high-bg: #3A1D22;
  --sev-medium: #EDAD57;
  --sev-medium-bg: #3B2A16;
  --sev-low: #6FA9E8;
  --sev-low-bg: #172A3D;

  --shadow-s: 0 1px 2px rgba(0,0,0,.3);
  --shadow-m: 0 4px 14px rgba(0,0,0,.45);
  --shadow-l: 0 12px 32px rgba(0,0,0,.55);
}

/* ============ AUTH / LOGIN ============ */
body.pre-auth .app-shell,
body.pre-auth .fab-wrap{display:none;}
.login-overlay{display:none;}
body.pre-auth .login-overlay{display:block; min-height:100vh; background:var(--bg);}

.login-split{display:flex; min-height:100vh;}
.login-branding{
  flex:1; color:#fff; padding:56px 64px;
  display:flex; flex-direction:column; justify-content:center;
  background:linear-gradient(160deg,#0b0f2b,#1a1140 60%,#1c1030);
}
.login-branding .name, .login-branding .sub{color:#fff;}
.login-headline{font-size:34px; font-weight:800; line-height:1.2; margin:0 0 14px;}
.login-headline span{color:var(--primary);}
.login-features{display:flex; flex-direction:column; gap:16px; margin-top:28px;}
.login-feature{display:flex; gap:12px; align-items:flex-start;}
.login-feature .glyph{
  width:36px; height:36px; border-radius:10px; background:rgba(255,255,255,.08);
  display:flex; align-items:center; justify-content:center; flex:none; font-size:16px;
}
.login-feature b{font-size:14px;}
.login-feature p{margin:2px 0 0; font-size:12.5px; color:rgba(255,255,255,.65);}
.login-footer{margin-top:40px; color:rgba(255,255,255,.45) !important;}

.login-card{
  width:420px; flex:none; margin:auto; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-l); box-shadow:var(--shadow-l); padding:36px 34px;
}
.login-pw-wrap{position:relative;}
.login-pw-wrap input{width:100%; padding-right:36px;}
.login-pw-toggle{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:14px; color:var(--text-faint); padding:4px;
}

.auth-badge{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  font-size:12.5px; font-weight:600; color:var(--text-dim); margin-bottom:8px;
}
.auth-role{white-space:nowrap;}

@media (max-width: 860px){
  .login-branding{display:none;}
  .login-card{width:92%; max-width:400px; margin:auto;}
}
@media (max-width: 420px){
  .login-card{padding:26px 20px;}
}

.tc-file-card{cursor:pointer; transition:box-shadow .15s, border-color .15s;}
/* No transform here on purpose: a transformed ancestor becomes the containing
   block for any position:fixed descendant, which breaks the kebab menu
   (.action-menu-list) positioning math (computed in viewport coordinates)
   right when the card is hovered to click it. */
.tc-file-card:hover{box-shadow:var(--shadow-m); border-color:var(--primary);}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:var(--font-ui);
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
button, input, select, textarea{font-family:inherit; color:inherit;}
a{color:var(--primary); text-decoration:none;}
::selection{background:var(--primary); color:#fff;}
:focus-visible{outline:2px solid var(--primary); outline-offset:2px;}

/* Scrollbar */
::-webkit-scrollbar{width:10px; height:10px;}
::-webkit-scrollbar-thumb{background:var(--border); border-radius:6px;}
::-webkit-scrollbar-track{background:transparent;}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:.01ms !important; transition-duration:.01ms !important;}
}

/* ============ LAYOUT ============ */
.app-shell{display:flex; min-height:100vh;}

.sidebar{
  width:var(--sidebar-w);
  background:var(--surface);
  border-right:1px solid var(--border);
  position:fixed; top:0; left:0; bottom:0;
  display:flex; flex-direction:column;
  z-index:40;
  transition:transform .25s ease;
}
.sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding:20px 20px 16px;
  border-bottom:1px solid var(--border);
}
.sidebar-brand .mark{
  width:34px; height:34px; border-radius:10px;
  background:linear-gradient(135deg, var(--primary), var(--status-passed));
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-family:var(--font-id); font-weight:700; font-size:13px;
  flex:none;
}
.sidebar-brand .name{font-weight:800; font-size:15px; letter-spacing:.2px;}
.sidebar-brand .sub{font-size:11px; color:var(--text-faint); font-family:var(--font-id); text-transform:uppercase; letter-spacing:.08em;}

.nav{padding:14px 12px; display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto;}
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:var(--radius-s);
  color:var(--text-dim); font-size:14px; font-weight:600;
  cursor:pointer; position:relative; user-select:none;
  transition:background .15s, color .15s;
}
.nav-item .icon{width:18px; height:18px; flex:none; display:flex; align-items:center; justify-content:center;}
.nav-item:hover{background:var(--surface-alt); color:var(--text);}
.nav-item.active{background:var(--primary-soft); color:var(--primary);}
.nav-item.active::before{
  content:""; position:absolute; left:-12px; top:8px; bottom:8px; width:3px;
  border-radius:0 3px 3px 0; background:var(--primary);
}
.nav-item .count{
  margin-left:auto; font-family:var(--font-id); font-size:11px; font-weight:600;
  color:var(--text-faint); background:var(--surface-alt); border-radius:20px; padding:1px 7px;
}

.nav-group .nav-group-toggle .arrow{margin-left:auto; font-size:11px; transition:transform .15s;}
.nav-group.open .nav-group-toggle .arrow{transform:rotate(180deg);}
.nav-subitem{
  display:none; padding:9px 12px 9px 42px; border-radius:var(--radius-s);
  color:var(--text-dim); font-size:13.5px; font-weight:600; cursor:pointer; user-select:none;
  position:relative; transition:background .15s, color .15s;
}
.nav-group.open .nav-subitem{display:block;}
.nav-subitem:hover{background:var(--surface-alt); color:var(--text);}
.nav-subitem.active{background:var(--primary-soft); color:var(--primary);}
.nav-subitem.active::before{
  content:""; position:absolute; left:-12px; top:6px; bottom:6px; width:3px;
  border-radius:0 3px 3px 0; background:var(--primary);
}

.sidebar-footer{padding:14px 16px; border-top:1px solid var(--border);}
.theme-toggle{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius-m);
  padding:8px 10px; cursor:pointer; font-size:12.5px; font-weight:600; color:var(--text-dim);
}

.main{margin-left:var(--sidebar-w); flex:1; min-width:0; display:flex; flex-direction:column;}

.topbar{
  height:var(--header-h);
  position:sticky; top:0; z-index:30;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:16px;
  padding:0 24px;
}
.topbar .page-title{font-size:18px; font-weight:800; letter-spacing:-.01em;}
.topbar .page-sub{font-size:12.5px; color:var(--text-faint); margin-top:1px;}
.topbar-search{
  margin-left:auto; display:flex; align-items:center; gap:8px;
  background:var(--surface-alt); border:1px solid var(--border);
  border-radius:var(--radius-m); padding:8px 12px; width:280px;
}
.topbar-search input{border:none; background:transparent; outline:none; font-size:13.5px; width:100%;}
.hamburger{display:inline-flex; background:none; border:none; cursor:pointer; color:var(--text); font-size:18px; padding:4px;}

.content{padding:24px; flex:1;}
.page{display:none; animation:fadeIn .25s ease;}
.page.active{display:block;}
@keyframes fadeIn{from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);}}

/* ============ CARDS / GRID ============ */
.grid{display:grid; gap:16px;}
.grid-stats{grid-template-columns:repeat(auto-fit, minmax(160px,1fr));}
.grid-2col{grid-template-columns:1fr 1fr;}
@media (max-width:900px){.grid-2col{grid-template-columns:1fr;}}

.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  box-shadow:var(--shadow-s); padding:18px;
}
.card-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
.card-head h3{font-size:14.5px; font-weight:700; margin:0;}
.card-head .hint{font-size:11.5px; color:var(--text-faint);}

.stat-card{
  background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--rail, var(--primary));
  border-radius:var(--radius-m); padding:14px 16px; box-shadow:var(--shadow-s);
  display:flex; flex-direction:column; gap:4px;
}
.stat-card .label{font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint);}
.stat-card .value{font-family:var(--font-id); font-size:26px; font-weight:700; line-height:1;}
.stat-card.mini .value{font-size:20px;}

/* ============ BUTTONS ============ */
.btn{
  display:inline-flex; align-items:center; gap:7px; justify-content:center;
  border-radius:var(--radius-s); border:1px solid var(--border);
  background:var(--surface); color:var(--text); font-size:13px; font-weight:600;
  padding:9px 14px; cursor:pointer; transition:transform .1s, box-shadow .15s, background .15s;
  white-space:nowrap;
}
.btn:hover{box-shadow:var(--shadow-s); transform:translateY(-1px);}
.btn:active{transform:translateY(0);}
.btn.primary{background:var(--primary); border-color:var(--primary); color:#fff;}
.btn.primary:hover{background:var(--primary-dark);}
.btn.danger{background:var(--status-failed); border-color:var(--status-failed); color:#fff;}
.btn.ghost{background:transparent; border-color:transparent;}
.btn.sm{padding:6px 10px; font-size:12px;}
.btn:disabled{opacity:.5; cursor:not-allowed;}
.btn.icon-only{padding:8px; width:34px; height:34px;}

.role-form-top{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
.role-perm-groups{
  max-height:400px; overflow-y:auto; display:grid; grid-template-columns:1fr 1fr;
  align-items:start; gap:10px; padding:2px 4px 2px 0;
}
.role-perm-group{border:1px solid var(--border); border-radius:var(--radius-s); background:var(--surface-alt); overflow:hidden;}
.role-perm-group-title{font-size:11px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; color:var(--text-dim); padding:8px 10px; border-bottom:1px solid var(--border); background:var(--surface);}
.role-perm-group-items{display:flex; flex-direction:column; padding:4px;}
#roleFormPerms .role-perm-group-items label{
  display:grid; grid-template-columns:16px 1fr; align-items:center; gap:8px;
  width:100%; box-sizing:border-box; font-size:12.5px; font-weight:400; color:var(--text);
  cursor:pointer; padding:6px 8px; border-radius:6px; line-height:1.3;
}
#roleFormPerms .role-perm-group-items label:hover{background:var(--surface);}
#roleFormPerms .role-perm-group-items input[type=checkbox]{width:16px; height:16px; margin:0;}
#roleFormPerms .role-perm-group-items label span{min-width:0; overflow-wrap:break-word;}
@media (max-width:640px){ .role-form-top{grid-template-columns:1fr;} .role-perm-groups{grid-template-columns:1fr;} }

.fab-wrap{position:fixed; right:28px; bottom:28px; z-index:35; display:flex; flex-direction:column; align-items:flex-end; gap:12px;}
.fab{
  width:54px; height:54px; border-radius:50%;
  background:var(--primary); color:#fff; border:none;
  box-shadow:var(--shadow-l); font-size:24px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s;
}
.fab-wrap.open .fab{transform:rotate(45deg);}
.fab-menu{
  display:flex; flex-direction:column; gap:8px;
  opacity:0; visibility:hidden; transform:translateY(8px);
  transition:opacity .15s, transform .15s, visibility .15s;
}
.fab-wrap.open .fab-menu{opacity:1; visibility:visible; transform:translateY(0);}
.fab-menu-item{
  display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--border); color:var(--text);
  border-radius:var(--radius-s); padding:9px 14px; font-size:13px; font-weight:600;
  box-shadow:var(--shadow-m); cursor:pointer; white-space:nowrap;
}
.fab-menu-item:hover{border-color:var(--primary); color:var(--primary);}

/* ============ FORM ============ */
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:14px;}
.field label{font-size:12.5px; font-weight:700; color:var(--text-dim);}
.field .req{color:var(--status-failed);}
.field input, .field select, .field textarea{
  border:1px solid var(--border); border-radius:var(--radius-s); padding:9px 11px;
  background:var(--surface); font-size:13.5px; outline:none; width:100%;
  transition:border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--primary);}
.field textarea{resize:none; min-height:70px;} /* fixed size keeps form grids aligned */
/* Fields the user fills stay white; auto-filled / locked ones are gray. */
.field.readonly input, .field.readonly textarea,
.field input[readonly], .field textarea[readonly],
.field input:disabled, .field select:disabled, .field textarea:disabled{background:var(--surface-alt); color:var(--text-faint);}
.form-row{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
@media (max-width:640px){.form-row{grid-template-columns:1fr;}}
.data-table{width:100%; border-collapse:collapse; font-size:13px;}

.rich-editor .ql-container{min-height:120px; font-size:13.5px; font-family:var(--font-id, inherit); background:var(--surface); color:var(--text);}
.rich-editor .ql-editor{min-height:120px;}
.rich-editor .ql-toolbar{background:var(--surface-alt); border-color:var(--border) !important;}
.rich-editor .ql-container{border-color:var(--border) !important;}
.rich-editor .ql-stroke{stroke:var(--text-dim);}
.rich-editor .ql-fill{fill:var(--text-dim);}
.rich-editor .ql-picker{color:var(--text-dim);}
.ql-display{border:1px solid var(--border); border-radius:8px; padding:9px 11px; font-size:13.5px; min-height:20px; background:var(--surface-alt); color:var(--text);}
.ql-display p{margin:0 0 6px;}
.ql-display p:last-child{margin-bottom:0;}

.bug-detail-grid{display:grid; grid-template-columns:1fr 220px; align-items:start; gap:22px;}
@media (max-width:680px){ .bug-detail-grid{grid-template-columns:1fr;} .bug-detail-main{max-height:none;} .bug-detail-side{position:static;} }

/* Only the long-form content scrolls; the Details sidebar stays put. */
.bug-detail-main{display:flex; flex-direction:column; gap:14px; min-width:0; max-height:55vh; overflow-y:auto; padding-right:8px;}
.bug-detail-side{position:sticky; top:0;}
.bug-detail-title{margin:0; font-size:17px; font-weight:800; line-height:1.35; word-break:break-word;}

.bug-detail-block-label{font-size:11px; font-weight:700; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px;}
.bug-detail-block-body{
  font-size:13.5px; line-height:1.6; white-space:pre-wrap; word-break:break-word;
  background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius-s);
  padding:10px 12px;
}

.bug-detail-side{
  display:flex; flex-direction:column; gap:12px;
  background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius-m);
  padding:14px; align-self:start;
}
.bug-side-heading{font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--primary); padding-bottom:8px; border-bottom:1px solid var(--border);}
.bug-side-field{display:flex; flex-direction:column; gap:4px;}
.bug-side-label{font-size:10.5px; font-weight:700; color:var(--text-faint); text-transform:uppercase; letter-spacing:.05em;}
.bug-side-value{font-size:13px; font-weight:600; word-break:break-word;}

.bug-chat-section{
  background:var(--surface-alt); border:1px solid var(--border); border-radius:var(--radius-m);
  padding:14px 16px; margin-top:16px;
}
.bug-chat-tabs{display:flex; gap:4px; margin-bottom:12px; border-bottom:1px solid var(--border);}
.bug-chat-tab{padding:8px 14px; cursor:pointer; font-size:12.5px; font-weight:700; color:var(--text-dim); border-bottom:2px solid transparent; margin-bottom:-1px; user-select:none;}
.bug-chat-tab:hover{color:var(--text);}
.bug-chat-tab.active{color:var(--primary); border-bottom-color:var(--primary);}
.bug-chat-list{display:flex; flex-direction:column; gap:10px; max-height:340px; overflow-y:auto; margin-bottom:12px; padding:2px 6px 2px 2px;}
.bug-chat-notice{align-self:flex-start; font-size:11.5px; color:var(--text-faint); background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:3px 12px;}
.bug-chat-msg{padding:10px 12px; border-radius:var(--radius-s); background:var(--surface); border:1px solid var(--border);}
.bug-chat-author{font-size:12px; font-weight:700; color:var(--text-dim);}
.bug-chat-time{font-size:10.5px; color:var(--text-faint); font-weight:400; margin-left:6px;}
.bug-chat-text{font-size:13px; white-space:pre-wrap; word-break:break-word; margin-top:4px; max-height:220px; overflow-y:auto; line-height:1.5;}
.bug-chat-text a{word-break:break-all;}
.bug-chat-composer{display:flex; gap:8px; align-items:flex-end;}
.bug-chat-composer textarea{flex:1; resize:none; min-height:38px; max-height:200px; font-family:inherit; background:var(--surface);}
.data-table th, .data-table td{padding:9px 12px; text-align:left; border-bottom:1px solid var(--border); white-space:nowrap;}
.data-table th{background:var(--bg); font-weight:700; color:var(--text-dim); font-size:11.5px; text-transform:uppercase; letter-spacing:.04em;}
.data-table tr:last-child td{border-bottom:none;}
.divider{height:1px; background:var(--border); margin:16px 0;}
.section-label{font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:var(--primary); margin:4px 0 10px;}

/* ============ TABLE ============ */
.table-wrap{overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius-m); background:var(--surface);}
table.data-table{width:100%; border-collapse:collapse; font-size:13px; min-width:900px;}
table.data-table thead th{
  position:sticky; top:0; background:var(--surface-alt); z-index:5;
  text-align:left; padding:11px 12px; font-size:11.5px; font-weight:800;
  text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim);
  border-bottom:1px solid var(--border); cursor:pointer; white-space:nowrap;
}
table.data-table thead th.sortable:hover{color:var(--primary);}
table.data-table thead th .arrow{margin-left:4px; opacity:.5; font-size:10px;}
table.data-table tbody td{padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:middle;}
table.data-table tbody tr:hover{background:var(--surface-alt);}
table.data-table tbody tr:last-child td{border-bottom:none;}
.mono{font-family:var(--font-id); font-weight:600; font-size:12.5px;}
.cell-actions{display:flex; gap:6px;}
.truncate{max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

.toolbar{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px;}
.toolbar .spacer{flex:1;}
.filter-select{border:1px solid var(--border); background:var(--surface); border-radius:var(--radius-s); padding:8px 10px; font-size:12.5px; font-weight:600;}
input[type="date"].filter-select{min-width:130px; color-scheme:light dark; cursor:pointer;}
input[type="date"].filter-select::-webkit-calendar-picker-indicator{cursor:pointer;}
.search-box{display:flex; align-items:center; gap:7px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s); padding:8px 11px; min-width:220px;}
.search-box input{border:none; outline:none; background:transparent; font-size:13px; width:100%;}

.pagination{display:flex; align-items:center; gap:6px; justify-content:flex-end; margin-top:14px; font-size:12.5px;}
.pagination button{border:1px solid var(--border); background:var(--surface); border-radius:var(--radius-s); padding:6px 10px; cursor:pointer; font-weight:600;}
.pagination button.active{background:var(--primary); color:#fff; border-color:var(--primary);}
.pagination button:disabled{opacity:.4; cursor:not-allowed;}

/* ============ BADGES ============ */
.badge{display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:20px; font-size:11.5px; font-weight:700; white-space:nowrap;}
.badge .dot{width:6px; height:6px; border-radius:50%; background:currentColor;}
.badge.st-passed{background:var(--status-passed-bg); color:var(--status-passed);}
.badge.st-failed{background:var(--status-failed-bg); color:var(--status-failed);}
.badge.st-blocked{background:var(--status-blocked-bg); color:var(--status-blocked);}
.badge.st-notrun{background:var(--status-notrun-bg); color:var(--status-notrun);}
.badge.st-retest{background:var(--status-retest-bg); color:var(--status-retest);}
.badge.sev-critical{background:var(--sev-critical-bg); color:var(--sev-critical);}
.badge.sev-high{background:var(--sev-high-bg); color:var(--sev-high);}
.badge.sev-medium{background:var(--sev-medium-bg); color:var(--sev-medium);}
.badge.sev-low{background:var(--sev-low-bg); color:var(--sev-low);}
.badge.bug-open{background:var(--sev-critical-bg); color:var(--bug-open);}
.badge.bug-assigned{background:var(--status-blocked-bg); color:var(--bug-assigned);}
.badge.bug-inprogress{background:var(--sev-low-bg); color:var(--bug-inprogress);}
.badge.bug-readytotest{background:var(--primary-soft); color:var(--bug-readytotest);}
.badge.bug-reopened{background:var(--sev-critical-bg); color:var(--bug-reopened);}
.badge.bug-closed{background:var(--status-passed-bg); color:var(--bug-closed);}
.badge.priority{background:var(--surface-alt); color:var(--text-dim); border:1px solid var(--border);}

/* ============ MODAL ============ */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,13,20,.5); backdrop-filter:blur(2px);
  display:none; align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal-overlay.active{display:flex; animation:fadeIn .15s ease;}
.modal{
  background:var(--surface); border-radius:var(--radius-l); box-shadow:var(--shadow-l);
  width:100%; max-width:640px; max-height:90vh; overflow-y:auto; padding:24px;
  border:1px solid var(--border);
}
.modal.lg{max-width:820px;}
.modal-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.modal-header h2{font-size:17px; font-weight:800; margin:0;}
.modal-footer{display:flex; justify-content:flex-end; gap:10px; margin-top:18px; padding-top:16px; border-top:1px solid var(--border);}
.close-x{background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-faint); line-height:1;}

.confirm-modal .modal{max-width:400px; text-align:center;}
.checklist-modal .modal{max-width:380px; text-align:left;}
.checklist-dialog-list{max-height:260px; overflow-y:auto; overflow-x:hidden; margin-bottom:14px; border:1px solid var(--border); border-radius:var(--radius-s);}
.checklist-dialog-item{display:flex; align-items:center; gap:10px; width:100%; box-sizing:border-box; padding:10px 12px; font-size:13.5px; text-align:left; cursor:pointer; border-bottom:1px solid var(--border);}
/* .field input (padding/border/background/width:100%) leaks onto this
   checkbox since it's nested inside a .field — reset it back to plain. */
.checklist-dialog-item input[type=checkbox]{
  flex:none; width:16px; height:16px; padding:0; margin:0; border:none; background:none;
}
.checklist-dialog-item span{flex:1; min-width:0; text-align:left; overflow-wrap:break-word;}
.checklist-dialog-item:last-child{border-bottom:none;}
.checklist-dialog-item:hover{background:var(--surface-alt);}
.confirm-modal .icon-warn{width:46px; height:46px; border-radius:50%; background:var(--status-failed-bg); color:var(--status-failed); display:flex; align-items:center; justify-content:center; margin:0 auto 12px; font-size:22px;}

/* ============ TOAST ============ */
.toast-stack{position:fixed; right:20px; top:20px; z-index:200; display:flex; flex-direction:column; gap:10px; align-items:flex-end;}
.toast{
  background:var(--text); color:var(--bg); border-radius:var(--radius-s); padding:12px 16px;
  box-shadow:var(--shadow-m); font-size:13px; font-weight:600; display:flex; align-items:center; gap:10px;
  animation:toastIn .2s ease; max-width:340px;
}
[data-theme="dark"] .toast{background:var(--surface-alt); color:var(--text); border:1px solid var(--border);}
.toast.success{border-left:4px solid var(--status-passed);}
.toast.error{border-left:4px solid var(--status-failed);}
.toast.info{border-left:4px solid var(--primary);}
.toast .undo{color:var(--primary); font-weight:800; cursor:pointer; margin-left:auto;}
@keyframes toastIn{from{opacity:0; transform:translateX(20px);} to{opacity:1; transform:translateX(0);}}

/* ============ EMPTY / LOADING ============ */
.empty-state{display:flex; flex-direction:column; align-items:center; justify-content:center; padding:60px 20px; text-align:center; color:var(--text-faint);}
.empty-state .glyph{font-size:40px; margin-bottom:10px;}
.empty-state h4{margin:4px 0; color:var(--text);}
.loading-overlay{position:fixed; inset:0; background:var(--bg); display:flex; align-items:center; justify-content:center; z-index:500; flex-direction:column; gap:10px;}
.spinner{width:34px; height:34px; border-radius:50%; border:3px solid var(--border); border-top-color:var(--primary); animation:spin .7s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}

/* ============ ATTACHMENTS ============ */
.dropzone{
  border:2px dashed var(--border); border-radius:var(--radius-m); padding:22px; text-align:center;
  color:var(--text-faint); cursor:pointer; font-size:13px; transition:border-color .15s, background .15s;
}
.dropzone.dragover{border-color:var(--primary); background:var(--primary-soft);}
.attach-grid{display:flex; flex-wrap:wrap; gap:10px; margin-top:10px;}
.attach-thumb{position:relative; width:84px; height:84px; border-radius:var(--radius-s); overflow:hidden; border:1px solid var(--border); background:var(--surface-alt);}
.attach-thumb img, .attach-thumb video{width:100%; height:100%; object-fit:cover;}
.attach-thumb .rm{position:absolute; top:2px; right:2px; background:rgba(0,0,0,.6); color:#fff; border:none; border-radius:50%; width:18px; height:18px; font-size:11px; cursor:pointer;}
.attach-thumb .fname{position:absolute; bottom:0; left:0; right:0; background:rgba(0,0,0,.55); color:#fff; font-size:9px; padding:2px 3px; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

/* ============ CHARTS ============ */
.chart-box{position:relative; height:230px;}
.progress-bar-outer{height:10px; background:var(--surface-alt); border-radius:20px; overflow:hidden; display:flex;}
.progress-bar-outer span{height:100%;}

/* ============ SUMMARY PAGE ============ */
.sum-section{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m); box-shadow:var(--shadow-s); padding:20px; margin-bottom:18px;}
.sum-section-head{display:flex; align-items:center; gap:8px; margin-bottom:2px;}
.sum-section-head h2{font-size:15.5px; font-weight:800; margin:0; letter-spacing:.02em;}
.sum-section-head .icon{font-size:16px;}
.sum-section .sum-hint{font-size:12.5px; color:var(--text-faint); margin:0 0 16px;}

.sum-card-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:12px;}
.sum-card-grid > *{min-width:0;}

.bug-summary-grid{display:grid; grid-template-columns:220px 220px 1fr 1fr; gap:16px;}
.bug-summary-grid > *{min-width:0;}
@media (max-width:1100px){.bug-summary-grid{grid-template-columns:1fr 1fr;}}
@media (max-width:760px){.bug-summary-grid{grid-template-columns:1fr;}}
.sum-card{
  background:var(--card-bg, var(--surface-alt)); border:1px solid var(--card-border, var(--border));
  border-radius:var(--radius-m); padding:14px 16px; display:flex; flex-direction:column; gap:10px;
}
.sum-card .sum-card-top{display:flex; align-items:center; gap:8px;}
.sum-card .sum-card-icon{
  width:26px; height:26px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:13px; background:var(--card-accent-bg, var(--primary-soft)); color:var(--card-accent, var(--primary)); flex:none;
}
.sum-card .sum-card-label{font-size:12.5px; font-weight:700; color:var(--card-accent, var(--primary));}
.sum-card .sum-card-value{font-family:var(--font-id); font-size:28px; font-weight:700; line-height:1;}
.sum-card .sum-card-sub{font-size:11.5px; color:var(--text-faint); margin-top:-6px;}
.sum-card .sum-mini-bar{height:5px; border-radius:20px; background:var(--border); overflow:hidden;}
.sum-card .sum-mini-bar span{display:block; height:100%; background:var(--card-accent, var(--primary));}

.sum-overall{display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;}
.sum-overall .progress-bar-outer{flex:1; height:12px; min-width:120px;}
.sum-overall .sum-overall-pct{font-family:var(--font-id); font-size:24px; font-weight:800; color:var(--status-passed); text-align:right;}
.sum-overall .sum-overall-sub{font-size:11.5px; color:var(--text-faint); text-align:right;}

.sum-donut-card{display:grid; grid-template-columns:auto 1fr; gap:20px; align-items:center; min-width:0;}
.sum-donut-card > *{min-width:0;}
.sum-donut-wrap{position:relative; width:170px; height:170px; flex:none;}
@media (max-width:420px){ .sum-donut-wrap{width:130px; height:130px;} }
.sum-donut-wrap .sum-donut-center{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center; pointer-events:none;
}
.sum-donut-wrap .sum-donut-center b{display:block; font-family:var(--font-id); font-size:22px; line-height:1.1;}
.sum-donut-wrap .sum-donut-center span{font-size:11px; color:var(--text-faint);}
.sum-legend{display:flex; flex-direction:column; gap:12px;}
.sum-legend-row{display:grid; grid-template-columns:16px minmax(0,1fr) auto; align-items:center; gap:10px;}
.sum-legend-row .dot{width:9px; height:9px; border-radius:50%;}
.sum-legend-row .sum-legend-bar{height:5px; border-radius:20px; background:var(--border); overflow:hidden;}
.sum-legend-row .sum-legend-bar span{display:block; height:100%;}
.sum-legend-row .sum-legend-val{font-size:12.5px; font-weight:700; white-space:nowrap; text-align:right;}
@media (max-width:760px){ .sum-donut-card{grid-template-columns:1fr;} }

/* ============ MISC ============ */
.kbd{font-family:var(--font-id); background:var(--surface-alt); border:1px solid var(--border); border-radius:5px; padding:1px 6px; font-size:11px;}
.tag-list{display:flex; gap:6px; flex-wrap:wrap;}
.bulk-bar{display:flex; align-items:center; gap:10px; background:var(--primary-soft); border:1px solid var(--primary); border-radius:var(--radius-s); padding:9px 14px; margin-bottom:12px; font-size:13px; font-weight:600; color:var(--primary);}
.checkbox{width:16px; height:16px; cursor:pointer;}

/* Minimized sidebar (desktop only): icon rail, labels shown as tooltips. */
@media (min-width:1025px){
  body.sidebar-collapsed{--sidebar-w:68px;}
  .sidebar, .main{transition:width .2s ease, margin-left .2s ease;}
  body.sidebar-collapsed .sidebar .sidebar-brand{justify-content:center; padding-left:0; padding-right:0;}
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-item .count,
  body.sidebar-collapsed .nav-group-toggle .arrow,
  body.sidebar-collapsed .nav-subitem,
  body.sidebar-collapsed .auth-badge{display:none;}
  body.sidebar-collapsed .nav-item{justify-content:center; padding-left:0; padding-right:0;}
  body.sidebar-collapsed .sidebar-footer{padding:14px 10px;}
  body.sidebar-collapsed .theme-toggle{justify-content:center;}
}

/* Responsive */
.sidebar-backdrop{display:none;}
@media (max-width:1024px){
  .sidebar{transform:translateX(-100%);}
  .sidebar.open{transform:translateX(0);}
  .main{margin-left:0;}
  .topbar-search{width:180px;}
  .sidebar-backdrop{
    display:block; position:fixed; inset:0; background:rgba(10,13,20,.45);
    z-index:39; opacity:0; visibility:hidden; transition:opacity .2s, visibility .2s;
  }
  .sidebar-backdrop.open{opacity:1; visibility:visible;}
}
@media (max-width:640px){
  .topbar{flex-wrap:wrap; height:auto; min-height:var(--header-h); padding:12px 14px; row-gap:10px;}
  .topbar-search{width:100%; margin-left:0;}
  .content{padding:14px;}
  table.data-table{min-width:760px;}
  .modal{padding:18px;}
  .modal-footer{flex-wrap:wrap;}
  .cell-actions{flex-wrap:wrap;}
  .fab-wrap{right:16px; bottom:16px;}
}

/* ============ TOOLBAR DROPDOWN (Filter / Export) ============ */
.dropdown{position:relative;}
.dropdown-panel{
  display:none; position:absolute; top:calc(100% + 6px); left:0; z-index:50;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m);
  box-shadow:var(--shadow-l); padding:12px; min-width:200px;
  flex-direction:column; gap:8px;
}
.dropdown.open .dropdown-panel{display:flex;}
.dropdown-panel .filter-select{width:100%;}
.dropdown-panel.filter-panel{min-width:230px; gap:12px;}
.filter-field{display:flex; flex-direction:column; gap:5px;}
.filter-field label{font-size:11px; font-weight:700; color:var(--text-dim); text-transform:uppercase; letter-spacing:.03em;}
.filter-panel-footer{border-top:1px solid var(--border); margin-top:2px; padding-top:10px;}
.filter-panel-footer .btn{width:100%; justify-content:center;}
.dropdown-item{
  background:none; border:none; text-align:left; padding:8px 10px; border-radius:var(--radius-s);
  font-size:13px; font-weight:600; color:var(--text); cursor:pointer; white-space:nowrap;
}
.dropdown-item:hover{background:var(--surface-alt); color:var(--primary);}
.dropdown-panel.right{left:auto; right:0;}
.dropdown-panel-fixed{position:fixed; top:auto; left:auto;}
.row-actions-btn{background:none; border:1px solid var(--border); border-radius:var(--radius-s); width:30px; height:30px; font-size:16px; font-weight:700; color:var(--text); cursor:pointer; line-height:1;}
.row-actions-btn:hover{background:var(--surface-alt); color:var(--primary);}

/* ============ COMBOBOX (searchable select, e.g. Module on Test Case) ============ */
.combobox{width:100%;}
.combobox-trigger{
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s);
  padding:9px 12px; font-size:13.5px; color:var(--text); cursor:pointer; text-align:left;
}
.combobox.open .combobox-trigger{border-color:var(--primary);}
.combobox.invalid .combobox-trigger{border-color:var(--status-failed);}
.combobox-panel{width:100%; min-width:0; max-height:280px;}
.combobox-list{overflow-y:auto; max-height:180px; display:flex; flex-direction:column; gap:2px;}
.combobox-option{white-space:normal; background:none; border:none; text-align:left; padding:8px 10px; border-radius:var(--radius-s); font-size:13px; font-weight:600; color:var(--text); cursor:pointer;}
.combobox-option:hover{background:var(--surface-alt); color:var(--primary);}
.combobox-add{
  width:100%; background:none; border:none; border-top:1px solid var(--border); border-radius:0;
  text-align:left; padding:10px 10px 0; margin-top:2px; font-size:13px; font-weight:600;
  color:var(--primary); cursor:pointer;
}
.combobox-empty{text-align:center; padding:18px 8px; color:var(--text-faint); font-size:12.5px;}
.combobox-empty-icon{font-size:22px; margin-bottom:6px;}
.combobox-empty p{color:var(--text-dim); font-weight:600; font-size:13px; margin:0 0 2px;}
.combobox-error{color:var(--status-failed); font-size:12px; margin:6px 0 0; padding:0 2px;}
.input-invalid{border-color:var(--status-failed) !important;}
.field-error{display:none; color:var(--status-failed); font-size:12px; margin-top:4px;}
.field-error.show{display:block;}

.action-menu{position:relative; display:inline-block;}
.action-menu-btn{background:none; border:1px solid var(--border); border-radius:var(--radius-s); width:28px; height:28px; line-height:1; cursor:pointer; font-size:16px; color:var(--text-dim);}
.action-menu-btn:hover{background:var(--surface-alt);}
.action-menu-list{display:none; position:fixed; z-index:2000; min-width:150px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s); box-shadow:0 4px 16px rgba(0,0,0,.12); padding:4px; flex-direction:column; gap:2px;}
.action-menu.open .action-menu-list{display:flex;}
.action-menu-list button{display:flex; align-items:center; gap:8px; width:100%; text-align:left; background:none; border:none; padding:7px 10px; border-radius:6px; font-size:13px; cursor:pointer; color:var(--text);}
.action-menu-list button:hover{background:var(--surface-alt);}
.action-menu-list button.danger{color:var(--status-failed); border-top:1px solid var(--border); margin-top:2px; padding-top:9px; border-radius:0 0 6px 6px;}
.action-menu-list button.danger:hover{background:var(--status-failed-bg);}
.col-hidden{display:none;}

/* ============ VIEW TOGGLE (Table/Board) ============ */
.view-toggle{display:flex; border:1px solid var(--border); border-radius:var(--radius-s); overflow:hidden;}
.view-toggle button{
  background:var(--surface); border:none; border-right:1px solid var(--border); color:var(--text-dim);
  font-size:12.5px; font-weight:600; padding:8px 12px; cursor:pointer;
}
.view-toggle button:last-child{border-right:none;}
.view-toggle button.active{background:var(--primary); color:#fff;}

/* ============ BOARD (Kanban) ============ */
.board-wrap{display:flex; gap:14px; overflow-x:auto; padding-bottom:8px; align-items:flex-start;}
.board-col{
  flex:none; width:260px; background:var(--surface-alt); border:1px solid var(--border);
  border-radius:var(--radius-m); display:flex; flex-direction:column; max-height:calc(100vh - 260px);
}
.board-col-head{
  display:flex; align-items:center; justify-content:space-between; padding:12px 14px;
  font-size:12.5px; font-weight:700; border-bottom:1px solid var(--border); color:var(--text-dim);
  text-transform:uppercase; letter-spacing:.03em;
}
.board-col-count{background:var(--surface); border-radius:20px; padding:1px 8px; font-size:11px;}
.board-col-body{flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:8px; min-height:60px;}
.board-col-body.drag-over{background:var(--primary-soft); outline:2px dashed var(--primary); outline-offset:-2px;}

.board-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s);
  padding:10px 12px; cursor:grab; box-shadow:var(--shadow-s); display:flex; flex-direction:column; gap:6px;
}
.board-card:hover{border-color:var(--primary);}
.board-card.dragging{opacity:.4;}
.board-card-top{display:flex; align-items:center; justify-content:space-between;}
.board-card-title{font-size:13px; font-weight:600; line-height:1.35;}
.board-card-meta{display:flex; justify-content:space-between; gap:8px; font-size:11.5px; color:var(--text-faint);}

@media (max-width:640px){
  .board-col{width:220px;}
}

.link-btn{background:none; border:none; color:var(--primary); font-weight:700; font-size:12.5px; cursor:pointer; padding:0;}
.text-dim{color:var(--text-dim);}
.text-faint{color:var(--text-faint);}
.flex-between{display:flex; align-items:center; justify-content:space-between;}
.gap-8{display:flex; gap:8px;}

.tf-field-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:8px; margin-top:10px; }
.field-check{ display:flex; align-items:center; gap:6px; font-size:13px; }
.tf-tabs{ display:flex; gap:8px; }
.tf-thumb-row{ display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.tf-thumb{ position:relative; width:80px; height:80px; }
.tf-thumb img{ width:100%; height:100%; object-fit:cover; border-radius:6px; }
.tf-thumb-remove{ position:absolute; top:-6px; right:-6px; background:#e03131; color:#fff; border:none; border-radius:50%; width:18px; height:18px; cursor:pointer; font-size:11px; line-height:1; }
.evidence-icon{ display:inline-flex; align-items:center; padding:4px; margin-right:2px; border-radius:6px; color:var(--primary); vertical-align:middle; }
a.evidence-icon:hover{ background:var(--primary-soft); }
.bug-chat-notice:has(.bug-chat-note){border-radius:10px; padding:6px 12px;}
.bug-chat-note{margin-top:4px; color:var(--text); font-size:12.5px; white-space:pre-wrap; word-break:break-word;}
/* Report (Go-Live readiness) */
.rpt-verdict{display:flex; align-items:center; gap:18px; border-left:6px solid var(--rpt-c); background:var(--rpt-bg);}
.rpt-go{--rpt-c:var(--status-passed); --rpt-bg:var(--status-passed-bg);}
.rpt-cond{--rpt-c:var(--status-blocked); --rpt-bg:var(--status-blocked-bg);}
.rpt-nogo{--rpt-c:var(--status-failed); --rpt-bg:var(--status-failed-bg);}
.rpt-na{--rpt-c:var(--status-notrun); --rpt-bg:var(--status-notrun-bg);}
.rpt-verdict-badge{font-size:22px; font-weight:800; color:var(--rpt-c); white-space:nowrap;}
.rpt-verdict-title{font-size:16px; font-weight:700;}
.rpt-pill{margin-left:auto; font-size:12px; font-weight:700; padding:3px 12px; border-radius:20px; color:var(--rpt-c); background:var(--rpt-bg);}
.rpt-lead{margin:10px 0 6px; font-size:14.5px;}
.rpt-list{margin:6px 0 0; padding-left:20px; font-size:13.5px; line-height:1.65;}
.rpt-subhead{margin:16px 0 8px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-dim);}
#page-report .sum-section-head .spacer{flex:1;}
@media (max-width:640px){ .rpt-verdict{flex-direction:column; align-items:flex-start; gap:6px;} }
.rpt-total td{font-weight:800; background:var(--bg);}
.data-table .rpt-pill{margin-left:0;}
.status-change-modal .modal{text-align:left; max-width:460px;}
.row-clickable{cursor:pointer;}
.row-clickable:hover td{background:var(--surface-alt);}
/* Global search suggestions */
.topbar-search{position:relative;}
.gs-results{display:none; position:absolute; top:calc(100% + 6px); right:0; width:min(420px, calc(100vw - 32px)); max-height:420px; overflow-y:auto; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-m); box-shadow:var(--shadow-s); z-index:50; padding:6px;}
.gs-results.open{display:block;}
.gs-group{display:flex; justify-content:space-between; padding:8px 10px 4px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--text-faint);}
.gs-item{display:grid; grid-template-columns:auto 1fr; column-gap:10px; padding:8px 10px; border-radius:var(--radius-s); cursor:pointer; font-size:13px;}
.gs-item:hover, .gs-item.active{background:var(--primary-soft);}
.gs-item .mono{font-size:12px; color:var(--primary); font-weight:700;}
.gs-title{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600;}
.gs-meta{grid-column:2; font-size:11.5px; color:var(--text-faint);}
.gs-empty{padding:12px 10px; font-size:13px; color:var(--text-faint);}
.btn.btn-back{padding:4px; color:var(--text);}
.btn.btn-back:hover{box-shadow:none; color:var(--primary);}
/* Notification bell */
.notif-wrap{position:relative; margin-left:8px;}
.notif-btn{position:relative; display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border:none; background:none; color:var(--text-dim); cursor:pointer; border-radius:50%;}
.notif-btn:hover{background:var(--surface-alt); color:var(--primary);}
.notif-badge{position:absolute; top:2px; right:0; min-width:17px; height:17px; padding:0 4px; border-radius:9px; background:var(--status-failed); color:#fff; font-size:10.5px; font-weight:700; display:flex; align-items:center; justify-content:center;}
.notif-panel{width:min(400px, calc(100vw - 32px));}
.notif-item{display:flex; gap:10px; padding:9px 10px; border-radius:var(--radius-s); cursor:pointer; font-size:13px;}
.notif-item:hover{background:var(--primary-soft);}
.notif-item.unread{background:color-mix(in srgb, var(--primary) 7%, transparent);}
.notif-item.unread .notif-text{font-weight:700;}
.notif-icon{flex:none; width:20px; text-align:center;}
.notif-note{font-size:12px; color:var(--text-dim); margin-top:2px; white-space:pre-wrap; word-break:break-word;}
.notif-meta{font-size:11.5px; color:var(--text-faint); margin-top:2px;}
/* File card info button + detail dialog */
.file-card-actions{display:flex; align-items:center; gap:2px; flex:none;}
.file-info-btn{display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border:none; background:none; color:var(--text-faint); cursor:pointer; border-radius:50%;}
.file-info-btn:hover{color:var(--primary); background:var(--surface-alt);}
.file-detail-row{display:flex; justify-content:space-between; gap:16px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13.5px;}
.file-detail-row span{color:var(--text-dim);}
.file-detail-row b{text-align:right; word-break:break-word;}
/* Workspace picker (after login) + topbar chip */
.ws-picker{display:none; position:fixed; inset:0; z-index:2000; background:var(--bg); overflow-y:auto;}
.ws-picker.open{display:block;}
.ws-picker-bar{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 20px; background:var(--surface); border-bottom:1px solid var(--border);}
.ws-picker-brand{display:flex; align-items:center; gap:8px; font-size:14px;}
.ws-picker-brand .mark{width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; background:linear-gradient(135deg, var(--primary), var(--status-passed));}
.ws-picker-user{display:flex; align-items:center; gap:10px; font-size:12.5px; color:var(--text-dim);}
.ws-picker-body{max-width:960px; margin:0 auto; padding:28px 20px 40px;}
.ws-picker-body h1{font-size:20px; margin:0;}
.ws-picker-body > p{margin:4px 0 20px; font-size:13.5px;}
.ws-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:14px;}
.ws-card{all:unset; box-sizing:border-box; display:flex; flex-direction:column; gap:12px; padding:16px; cursor:pointer; background:var(--surface); border:1px solid var(--border); border-radius:12px; transition:border-color .15s, box-shadow .15s;}
.ws-card:hover, .ws-card:focus-visible{border-color:var(--ws-fg); box-shadow:var(--shadow-s);}
.ws-card-head{display:flex; align-items:center; gap:10px;}
.ws-dot{width:36px; height:36px; flex:none; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; background:var(--ws-bg); color:var(--ws-fg);}
.ws-card-title{flex:1; min-width:0; display:flex; flex-direction:column;}
.ws-card-title b{font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ws-card-title span{font-size:12px; color:var(--text-faint);}
.ws-tag{font-size:11px; padding:2px 8px; border-radius:6px; background:var(--ws-bg); color:var(--ws-fg); font-weight:600;}
.ws-stats{display:grid; grid-template-columns:repeat(3, 1fr); gap:6px;}
.ws-stats div{background:var(--surface-alt); border-radius:8px; padding:8px 10px;}
.ws-stats b{display:block; font-size:16px;}
.ws-stats span{font-size:11px; color:var(--text-faint);}
.ws-act{font-size:12px; color:var(--text-dim); padding:6px 0; border-top:1px solid var(--border); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ws-open{font-size:13px; font-weight:700; color:var(--ws-fg);}
[data-theme="dark"] .ws-dot, [data-theme="dark"] .ws-tag{background:var(--ws-fg); color:var(--ws-bg);}
[data-theme="dark"] .ws-open{color:var(--ws-bg);}
.ws-remember{display:flex; align-items:center; gap:8px; margin-top:18px; font-size:13px; color:var(--text-dim); cursor:pointer;}
.ws-remember input{width:16px; height:16px;}
.ws-checklist{display:flex; flex-direction:column; gap:6px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-s); max-height:160px; overflow-y:auto;}
.ws-checklist label{display:flex; align-items:center; justify-content:flex-start; gap:10px; font-size:13.5px; font-weight:500; color:var(--text); text-align:left; cursor:pointer; padding:4px 2px;}
/* .field input is width:100% + padded — reset it for the checkboxes so they stay small and left */
.field .ws-checklist input[type="checkbox"]{width:16px; height:16px; flex:none; margin:0; padding:0; border:none; background:none; accent-color:var(--primary);}
/* Sidebar workspace switcher (bugrail_workspace_switcher_mockup.html) */
.ws-switcher{position:relative; padding:12px 12px 4px;}
.ws-switcher-label{font-size:11px; color:var(--text-faint); margin:0 0 4px 2px;}
.ws-switcher-btn{all:unset; box-sizing:border-box; width:100%; display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius-s); cursor:pointer; background:var(--surface);}
.ws-switcher-btn:hover{background:var(--surface-alt);}
.ws-switcher-text{flex:1; min-width:0; display:flex; flex-direction:column;}
.ws-switcher-text b{font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ws-switcher-text span{font-size:11px; color:var(--text-faint);}
.ws-switcher-caret{color:var(--text-faint); flex:none;}
.ws-dot.sm{width:28px; height:28px; font-size:12px;}
.ws-menu{display:none; position:absolute; left:12px; right:12px; top:calc(100% + 2px); z-index:60; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s); box-shadow:var(--shadow-s); padding:4px;}
.ws-menu.open{display:block;}
.ws-menu-item{all:unset; box-sizing:border-box; width:100%; display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--radius-s); cursor:pointer; font-size:13px; color:var(--text);}
.ws-menu-item:hover{background:var(--surface-alt);}
.ws-menu-item span:not(.ws-dot){flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.ws-menu-item .ws-check{flex:none; color:var(--primary); font-weight:700;}
.ws-menu-item.muted{color:var(--text-dim);}
.ws-menu-sep{border-top:1px solid var(--border); margin:4px 0;}
.tc-file-card.ws-colored{border-top:3px solid var(--ws-fg);}
.tc-file-add{all:unset; box-sizing:border-box; display:flex; align-items:center; justify-content:center; min-height:84px; border:1px dashed var(--border); border-radius:var(--radius-m); color:var(--text-faint); font-size:13px; cursor:pointer; background:transparent;}
.tc-file-add:hover{border-color:var(--primary); color:var(--primary);}
@media (min-width:1025px){
  body.sidebar-collapsed .ws-switcher-label, body.sidebar-collapsed .ws-switcher-text, body.sidebar-collapsed .ws-switcher-caret{display:none;}
  body.sidebar-collapsed .ws-switcher{padding:12px 10px 4px;}
  body.sidebar-collapsed .ws-switcher-btn{justify-content:center; padding:6px 0; border-color:transparent;}
  body.sidebar-collapsed .ws-menu{left:calc(100% - 4px); right:auto; top:12px; width:220px;}
}
.modal-header-actions{display:flex; align-items:center; gap:8px;}
/* Page size (segmented, same metrics as .pagination buttons) */
.pager-right{display:flex; align-items:center; justify-content:flex-end; gap:16px; flex-wrap:wrap;}
.flex-between:has(> .pager-right){margin-top:14px; align-items:center; gap:12px; flex-wrap:wrap;}
.pager-right .pagination{margin-top:0;}
.pagination button{height:30px; min-width:30px; padding:0 10px; display:inline-flex; align-items:center; justify-content:center;}
.page-size{display:inline-flex; align-items:center; gap:8px; font-size:12.5px; cursor:pointer;}
.page-size-label{color:var(--text-faint);}
.page-size select{appearance:none; -webkit-appearance:none; height:30px; padding:0 30px 0 12px; border:1px solid var(--border); border-radius:var(--radius-s); background-color:var(--surface); color:var(--text); font-size:12.5px; font-weight:600; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93A6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center;}
.page-size select:hover{border-color:var(--text-faint);}
.page-size select:focus-visible{outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft);}
