/* ============================================================
   FullBeat QA Platform — Design System
   BrainBoot Innovations
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Brand */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-dark: #4338ca;

  /* Semantic */
  --success: #16a34a;
  --success-hover: #15803d;
  --success-light: #dcfce7;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fee2e2;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-light: #fef3c7;
  --warning-bg: #fef3c7;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --info-bg: #e0f2fe;

  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Typography */
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: Consolas, 'Courier New', monospace;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Spacing */
  --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;

  /* Layout */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --max-width: 1400px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

code, pre {
  font-family: var(--font-mono);
}

::selection {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

/* ------------------------------------------------------------
   3. Layout
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: var(--space-6) 0;
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-6);
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* ------------------------------------------------------------
   4. Login Page
   ------------------------------------------------------------ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #6366f1 100%);
  padding: var(--space-4);
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  animation: fadeInUp 0.4s ease;
  margin: 80px auto;
}

.login-page .login-container {
  margin: 0;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-header .brand-logo,
.brand-logo {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 3px;
  margin-bottom: var(--space-1);
}

.login-header .brand-logo span {
  color: var(--gray-800);
}

.tagline {
  color: var(--gray-500);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.brand-sub {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: var(--space-1);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: #fff;
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.login-page .login-form {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.login-form .btn {
  width: 100%;
  margin-top: var(--space-2);
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: var(--text-sm);
}

.password-toggle {
  position: relative;
}

.password-toggle input {
  padding-right: 2.75rem;
}

.password-toggle button {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-1);
  font-size: var(--text-lg);
  line-height: 1;
}

.password-toggle button:hover {
  color: var(--gray-600);
}

/* ------------------------------------------------------------
   5. App Shell — Header
   ------------------------------------------------------------ */
.app-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  padding: 0 20px;
}

.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: var(--space-4);
}

.brand {
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand span {
  font-weight: 400;
  opacity: 0.85;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.project-selector {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  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='white' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 2rem;
  max-width: 240px;
}

.project-selector:hover {
  background: rgba(255, 255, 255, 0.25);
}

.project-selector option {
  color: var(--gray-800);
  background: #fff;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: #fff;
  font-size: 24px;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------------------------------------
   6. Navigation — Tab Bar
   ------------------------------------------------------------ */
.nav-tabs {
  background: #fff;
  border-bottom: 2px solid var(--gray-200);
  position: sticky;
  top: 56px;
  z-index: 90;
  padding: 0 20px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs .container {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-tabs .container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  color: var(--gray-500);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.nav-tab:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.nav-tab .tab-icon {
  font-size: var(--text-lg);
  line-height: 1;
}

.nav-tab .tab-count {
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nav-tab.active .tab-count {
  background: var(--primary-light);
  color: var(--primary);
}

/* Mobile nav overlay */
.nav-mobile-overlay {
  display: none;
}

/* ------------------------------------------------------------
   7. Cards
   ------------------------------------------------------------ */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-800);
}

.card-header h2,
.card-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Stat Cards (Dashboard) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-danger::before  { background: var(--danger); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-info::before    { background: var(--info); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  font-weight: 500;
  margin-top: var(--space-1);
}

.stat-change {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-2);
}

.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* Stat color variants */
.stat-success .stat-value,
.stat-success { color: var(--success); }
.stat-danger .stat-value,
.stat-danger  { color: var(--danger); }
.stat-warning .stat-value,
.stat-warning { color: var(--warning); }

/* ------------------------------------------------------------
   8. Tables
   ------------------------------------------------------------ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: var(--gray-50);
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  user-select: none;
}

th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

th.sortable:hover {
  color: var(--primary);
}

th.sortable::after {
  content: '\2195';
  margin-left: var(--space-1);
  opacity: 0.3;
}

th.sort-asc::after  { content: '\2191'; opacity: 1; color: var(--primary); }
th.sort-desc::after { content: '\2193'; opacity: 1; color: var(--primary); }

td,
tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--gray-50);
}

tbody tr:last-child td {
  border-bottom: none;
}

.inactive-row {
  opacity: 0.5;
}

.inactive-row td {
  text-decoration: line-through;
  text-decoration-color: var(--gray-400);
}

td.cell-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

td.cell-truncate {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ------------------------------------------------------------
   9. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  color: var(--gray-700);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.btn-warning:hover {
  background: var(--warning-hover);
  border-color: var(--warning-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--gray-600);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

/* Ghost variant for header (white text) */
.app-header .btn-ghost,
.btn-ghost-light {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.app-header .btn-ghost:hover,
.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.btn-icon {
  padding: var(--space-2);
  min-width: 36px;
  min-height: 36px;
}

.btn-icon.btn-sm {
  padding: var(--space-1);
  min-width: 28px;
  min-height: 28px;
}

.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}

/* ------------------------------------------------------------
   10. Badges
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.6;
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-success {
  background: var(--success-light);
  color: #15803d;
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-light);
  color: #b45309;
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
}

.badge-muted {
  background: #f1f5f9;
  color: #64748b;
}

/* Header badge variant (white on transparent) */
.app-header .badge-info {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.badge-dot {
  padding-left: 6px;
}

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  margin-right: 6px;
  background: currentColor;
}

/* ------------------------------------------------------------
   11. Forms
   ------------------------------------------------------------ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-1);
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="url"],
input[type="date"],
select,
textarea,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

input.input-error,
select.input-error,
textarea.input-error {
  border-color: var(--danger);
}

input.input-error:focus,
select.input-error:focus,
textarea.input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;
  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='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.form-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--space-1);
  min-height: 20px;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.form-actions.right {
  justify-content: flex-end;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check label {
  font-weight: 400;
  cursor: pointer;
}

/* Search input */
.search-input {
  position: relative;
}

.search-input input {
  padding-left: 2.25rem;
}

.search-input .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: var(--text-sm);
  pointer-events: none;
}

/* ------------------------------------------------------------
   12. Modals
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform var(--transition-base);
  overflow-y: auto;
  padding: var(--space-6);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-lg {
  max-width: 800px;
}

.modal-xl {
  max-width: 1000px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0;
}

.modal h3 {
  margin-bottom: var(--space-4);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: var(--text-xl);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   13. Filters
   ------------------------------------------------------------ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 160px;
}

.filter-group label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
  padding: 6px var(--space-3);
  font-size: var(--text-sm);
}

.filter-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

/* ------------------------------------------------------------
   14. Progress Bar
   ------------------------------------------------------------ */
.progress-bar-container {
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar.progress-lg {
  height: 12px;
}

.progress-bar.progress-sm {
  height: 4px;
}

.progress-fill,
.progress-bar-container .progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  min-width: 0;
}

.progress-fill.progress-success,
.progress-bar.bar-success { background: var(--success); }
.progress-fill.progress-danger,
.progress-bar.bar-danger  { background: var(--danger); }
.progress-fill.progress-warning { background: var(--warning); }

/* Stacked progress (for multi-status) */
.progress-stacked {
  display: flex;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-stacked .progress-segment {
  height: 100%;
  transition: width var(--transition-slow);
}

.progress-stacked .progress-segment:first-child {
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.progress-stacked .progress-segment:last-child {
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

/* ------------------------------------------------------------
   15. Verdict Banner
   ------------------------------------------------------------ */
.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.verdict-banner .verdict-icon {
  font-size: var(--text-3xl);
  line-height: 1;
}

.verdict-banner .verdict-text {
  flex: 1;
}

.verdict-banner .verdict-text small {
  display: block;
  font-weight: 400;
  font-size: var(--text-sm);
  margin-top: var(--space-1);
  opacity: 0.85;
  text-transform: none;
  letter-spacing: 0;
}

.verdict-go {
  background: var(--success-light);
  color: #15803d;
  border: 2px solid var(--success);
}

.verdict-nogo {
  background: var(--danger-light);
  color: var(--danger);
  border: 2px solid var(--danger);
}

.verdict-conditional {
  background: var(--warning-light);
  color: #b45309;
  border: 2px solid var(--warning);
}

.verdict-progress {
  background: var(--gray-100);
  color: var(--gray-500);
  border: 2px solid var(--gray-300);
}

/* ------------------------------------------------------------
   16. Status Buttons (Test Execution)
   ------------------------------------------------------------ */
.status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--gray-100);
  color: var(--gray-500);
}

.status-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.status-pass,
.status-btn.active-pass {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

.status-fail,
.status-btn.active-fail {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.status-blocked,
.status-btn.active-blocked {
  background: var(--warning-light);
  color: var(--warning);
  border-color: var(--warning);
}

.status-skip,
.status-btn.active-skip {
  background: var(--gray-100);
  color: var(--gray-600);
  border-color: var(--gray-400);
}

.status-group {
  display: flex;
  gap: var(--space-2);
}

/* ------------------------------------------------------------
   17. Expandable Rows
   ------------------------------------------------------------ */
.expandable-trigger {
  cursor: pointer;
}

.expandable-trigger .expand-icon {
  display: inline-block;
  transition: transform var(--transition-fast);
  font-size: var(--text-sm);
  color: var(--gray-400);
  margin-right: var(--space-2);
}

.expandable-trigger.expanded .expand-icon {
  transform: rotate(90deg);
}

.expandable-content {
  display: none;
  background: var(--gray-50);
  border-top: 1px dashed var(--gray-200);
}

.expandable-content.expanded {
  display: table-row;
}

.expandable-content td {
  padding: var(--space-4) var(--space-5);
}

.expandable-detail {
  display: none;
  padding: var(--space-4) var(--space-5);
  background: var(--gray-50);
  border-top: 1px dashed var(--gray-200);
  animation: slideDown 0.2s ease;
}

.expandable-detail.expanded {
  display: block;
}

/* ------------------------------------------------------------
   18. Timeline (Bug Lifecycle)
   ------------------------------------------------------------ */
.timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: var(--space-4) 0;
  overflow-x: auto;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1;
  min-width: 100px;
  padding: 0 var(--space-2);
}

.timeline-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--gray-300);
}

.timeline-step:first-child::before {
  display: none;
}

.timeline-step .step-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--gray-500);
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.timeline-step .step-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--gray-500);
  margin-top: var(--space-2);
}

.timeline-step .step-date {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* Active step */
.timeline-step.active .step-dot {
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 0 0 5px rgba(99, 102, 241, 0.2);
  color: #fff;
}

.timeline-step.active .step-label {
  color: var(--primary);
  font-weight: 700;
}

/* Completed step */
.timeline-step.completed .step-dot {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success);
  color: #fff;
}

.timeline-step.completed::before {
  background: var(--success);
}

.timeline-step.completed .step-label {
  color: var(--gray-700);
  font-weight: 600;
}

/* Vertical timeline variant */
.timeline-vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 14px;
}

.timeline-vertical .timeline-item {
  position: relative;
  padding-left: var(--space-6);
  padding-bottom: var(--space-5);
  border-left: 2px solid var(--gray-200);
}

.timeline-vertical .timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-vertical .timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  border: 2px solid #fff;
}

.timeline-vertical .timeline-item.active::before {
  background: var(--primary);
}

.timeline-vertical .timeline-item .item-time {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

.timeline-vertical .timeline-item .item-text {
  font-size: var(--text-sm);
  color: var(--gray-700);
  margin-top: 2px;
}

/* ------------------------------------------------------------
   19. Tester Cards (Dashboard)
   ------------------------------------------------------------ */
.tester-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.tester-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.tester-card:hover {
  box-shadow: var(--shadow-md);
}

.tester-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.tester-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.tester-card-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: var(--text-sm);
}

.tester-card-role {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.tester-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  text-align: center;
  font-size: var(--text-xs);
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
}

.tester-card-stats .tester-stat-value,
.tester-card-stats .stat-num {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-800);
  display: block;
}

.tester-card-stats .tester-stat-label,
.tester-card-stats .stat-lbl {
  font-size: 10px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tester-card .progress-bar {
  margin-top: var(--space-3);
}

/* ------------------------------------------------------------
   20. Wizard (Plan Creation)
   ------------------------------------------------------------ */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-8);
  padding: var(--space-4) 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
}

.wizard-step + .wizard-step::before {
  content: '';
  width: 48px;
  height: 2px;
  background: var(--gray-300);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}

.wizard-step .step-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.wizard-step .step-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-500);
  transition: color var(--transition-base);
}

.wizard-step.active .step-number {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.wizard-step.active .step-title {
  color: var(--primary);
  font-weight: 700;
}

.wizard-step.completed .step-number {
  background: var(--success);
  color: #fff;
}

.wizard-step.completed + .wizard-step::before {
  background: var(--success);
}

.wizard-step.completed .step-title {
  color: var(--gray-700);
}

.wizard-body {
  min-height: 300px;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
}

/* ------------------------------------------------------------
   21. Toast / Alerts
   ------------------------------------------------------------ */
.toast-container,
#toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-800);
  min-width: 300px;
  max-width: 450px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--gray-400);
}

.toast.toast-exiting {
  animation: toastOut 0.25s ease forwards;
}

.toast-success {
  border-left-color: var(--success);
  background: var(--success-light);
  color: #15803d;
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
  background: var(--danger-light);
  color: #991b1b;
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
  background: var(--warning-light);
  color: #92400e;
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info {
  border-left-color: var(--info);
  background: var(--info-light);
  color: #1e40af;
}

.toast-icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-1);
  font-size: var(--text-lg);
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--gray-600);
}

/* Inline Alert */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  border: 1px solid;
}

.alert-info {
  background: var(--info-light);
  border-color: #93c5fd;
  color: #1e40af;
}

.alert-success {
  background: var(--success-light);
  border-color: #86efac;
  color: #166534;
}

.alert-danger {
  background: var(--danger-light);
  border-color: #fca5a5;
  color: #991b1b;
}

.alert-warning {
  background: var(--warning-light);
  border-color: #fcd34d;
  color: #92400e;
}

/* ------------------------------------------------------------
   22. Loading States
   ------------------------------------------------------------ */

/* Spinner */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

.spinner-white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  flex-direction: column;
  gap: var(--space-3);
  color: var(--gray-500);
  font-size: var(--text-sm);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 24px;
  width: 40%;
  margin-bottom: var(--space-4);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 120px;
}

.skeleton-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
}

/* Loading overlay for cards/sections */
.loading-overlay {
  position: relative;
}

.loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 5;
}

/* ------------------------------------------------------------
   23. Empty State
   ------------------------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: var(--space-4);
}

.empty-state .empty-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.empty-state .empty-description {
  font-size: var(--text-sm);
  color: var(--gray-500);
  max-width: 360px;
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* ------------------------------------------------------------
   24. Plan Info Grid (Execution page)
   ------------------------------------------------------------ */
.plan-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}

.plan-info-item {
  font-size: var(--text-sm);
}

.plan-info-item strong {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

/* ------------------------------------------------------------
   25. Utility Classes
   ------------------------------------------------------------ */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: var(--text-sm); }
.text-xs      { font-size: var(--text-xs); }
.text-muted   { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-mono    { font-family: var(--font-mono); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.hidden { display: none !important; }
.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;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-4) 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ------------------------------------------------------------
   26. Animations
   ------------------------------------------------------------ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ------------------------------------------------------------
   27. Responsive — Tablet (768px)
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --space-6: 1rem;
  }

  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  /* Header */
  .hamburger {
    display: flex;
  }

  .header-controls {
    display: none;
  }

  .header-controls.open {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .header-controls .project-selector {
    max-width: 140px;
  }

  .user-info .user-name {
    display: none;
  }

  /* Navigation */
  .nav-tabs {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    width: 260px;
    height: calc(100vh - 56px);
    background: #fff;
    border-right: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    z-index: 99;
    overflow-y: auto;
    padding: 0;
  }

  .nav-tabs.open {
    display: flex;
  }

  .nav-tabs .container {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4) 0;
  }

  .nav-tab {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--gray-100);
    border-left: 3px solid transparent;
    border-radius: 0;
  }

  .nav-tab.active {
    border-bottom-color: var(--gray-100);
    border-left-color: var(--primary);
    background: var(--primary-light);
  }

  .nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 56px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 98;
  }

  .nav-mobile-overlay.active {
    display: block;
  }

  /* Grids */
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }

  /* Stat cards */
  .stat-cards,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    min-width: auto;
  }

  .filter-actions {
    margin-left: 0;
    justify-content: flex-end;
  }

  /* Wizard */
  .wizard-steps {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .wizard-step + .wizard-step::before {
    display: none;
  }

  /* Tables */
  .table-container {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    border-radius: 0;
  }

  /* Tester cards */
  .tester-cards {
    grid-template-columns: 1fr;
  }

  /* Verdict banner */
  .verdict-banner {
    flex-direction: column;
    text-align: center;
    font-size: var(--text-base);
  }

  /* Timeline */
  .timeline {
    flex-direction: column;
    padding-left: 14px;
  }

  .timeline-step {
    flex-direction: row;
    text-align: left;
    min-width: auto;
    padding: var(--space-2) 0;
  }

  .timeline-step::before {
    top: -50%;
    bottom: 50%;
    left: 14px;
    right: auto;
    width: 2px;
    height: auto;
  }

  /* Modal */
  .modal {
    max-height: 100vh;
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: auto;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* ------------------------------------------------------------
   28. Responsive — Mobile (480px)
   ------------------------------------------------------------ */
@media (max-width: 480px) {
  .page-title {
    font-size: var(--text-xl);
  }

  /* Header */
  .header-controls .project-selector {
    display: none;
  }

  /* Stat cards */
  .stat-cards,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: var(--text-2xl);
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Buttons */
  .btn-lg {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Cards */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  /* Login */
  .login-container {
    padding: var(--space-6);
  }

  .login-header .brand-logo,
  .brand-logo {
    font-size: var(--text-2xl);
  }

  /* Toast */
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  /* Tester card stats */
  .tester-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Status group */
  .status-group {
    flex-wrap: wrap;
  }

  /* Wizard */
  .wizard-step .step-title {
    font-size: var(--text-xs);
  }

  /* Modal */
  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------
   29. Print Styles
   ------------------------------------------------------------ */
@media print {
  .app-header,
  .nav-tabs,
  .filter-bar,
  .btn,
  .toast-container,
  #toast-container,
  .hamburger {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  .verdict-banner {
    border-width: 1px;
  }
}

/* ============================================================
   30. Alternative Header Layout (header-left / header-right)
   Used by: repository, plans, execution, bugs, admin pages
   ============================================================ */

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .header-left,
.app-header .header-right {
  display: flex;
  align-items: center;
}

/* When header uses header-left/header-right instead of header-inner */
.app-header:has(.header-left) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Fallback for browsers without :has() */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-selector-wrap {
  display: flex;
  align-items: center;
}

.project-selector-wrap select {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius, 8px);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.project-selector-wrap select option {
  color: #1e293b;
  background: #fff;
}

.user-name {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* ============================================================
   31. Main Content Area
   ============================================================ */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ============================================================
   32. Execution Page Specific Styles
   ============================================================ */

.scenario-link {
  color: var(--primary, #6366f1);
  text-decoration: none;
  cursor: pointer;
}

.scenario-link:hover {
  text-decoration: underline;
}

.remarks-link {
  color: var(--primary, #6366f1);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.remarks-link:hover {
  text-decoration: underline;
}

.executed-row {
  background: rgba(99, 102, 241, 0.02);
}

/* ============================================================
   33. Bug Detail Field Values
   ============================================================ */

.field-value {
  font-size: 14px;
  color: var(--text, #1e293b);
  padding: 6px 0;
}

/* ============================================================
   34. Responsive for alt header
   ============================================================ */

@media (max-width: 768px) {
  .header-left {
    gap: 8px;
  }

  .header-right {
    gap: 8px;
  }

  .header-right .user-name {
    display: none;
  }

  .project-selector-wrap select {
    max-width: 120px;
    font-size: 12px;
  }
}

/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #f8fafc;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.04);
}
.upload-dropzone p {
    margin: 4px 0;
    font-size: 15px;
    color: #64748b;
}
.upload-dropzone p:first-child {
    font-size: 18px;
    color: #334155;
}

/* Import Map Banner */
.import-map-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

/* Bug Status Grid */
.bug-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.bug-status-item {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
}
.bug-status-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}
.bug-status-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
@media (max-width: 480px) {
    .bug-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
