/* ==========================================================================
   Surfrizz QA & Acceptance Suite – Design System & Styles
   Aesthetic: Clean ocean-inspired tech, deep navy, vibrant cyan & coral accents
   ========================================================================== */

:root {
  /* Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-hover: #f1f5f9;
  
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Brand Accents (Surfrizz Ocean Teal & Deep Slate) */
  --brand-navy: #0f172a;
  --brand-ocean: #0284c7;
  --brand-cyan: #06b6d4;
  --brand-surf: #0ea5e9;
  --brand-glow: rgba(14, 165, 233, 0.15);

  /* Status Colors */
  --status-passed: #10b981;
  --status-passed-bg: #ecfdf5;
  --status-passed-border: #a7f3d0;
  
  --status-failed: #ef4444;
  --status-failed-bg: #fef2f2;
  --status-failed-border: #fecaca;

  --status-pending: #64748b;
  --status-pending-bg: #f8fafc;
  --status-pending-border: #cbd5e1;

  --prio-high: #f43f5e;
  --prio-high-bg: #fff1f2;
  --prio-high-border: #fecdd3;

  --prio-med: #f59e0b;
  --prio-med-bg: #fffbeb;
  --prio-med-border: #fde68a;

  /* Borders & Shadows */
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

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

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, .code-font {
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-ocean) 0%, var(--brand-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
  flex-shrink: 0;
}

.wave-icon {
  width: 26px;
  height: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-navy);
  text-transform: lowercase;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--brand-glow);
  color: var(--brand-ocean);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Sync indicator */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.sync-indicator.connected {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-passed);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  outline: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-ocean) 0%, var(--brand-cyan) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0274b0 0%, #0891b2 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-card-subtle);
  border-color: var(--border-subtle);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-danger-ghost:hover {
  color: var(--status-failed);
  background: var(--status-failed-bg);
  border-color: var(--status-failed-border);
}

.btn-text {
  background: none;
  border: none;
  color: var(--brand-ocean);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-text:hover {
  background: var(--brand-glow);
  text-decoration: underline;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: white;
  min-width: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  z-index: 110;
}

.dropdown.open .dropdown-menu {
  display: block;
  animation: fadeInDown 0.18s ease;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-card-subtle);
  color: var(--brand-ocean);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

/* KPI Summary Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.kpi-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-card.total .kpi-icon-wrap {
  background: #f0f9ff;
  color: var(--brand-ocean);
}

.kpi-card.passed .kpi-icon-wrap {
  background: var(--status-passed-bg);
  color: var(--status-passed);
}

.kpi-card.failed .kpi-icon-wrap {
  background: var(--status-failed-bg);
  color: var(--status-failed);
}

.kpi-card.pending .kpi-icon-wrap {
  background: #f1f5f9;
  color: var(--status-pending);
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.15rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-subtext {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.text-success { color: var(--status-passed); }
.text-danger { color: var(--status-failed); }
.text-muted { color: var(--text-secondary); }

/* Global Progress Bar */
.global-progress-wrap {
  margin-bottom: 1.5rem;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.progress-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.progress-segment.passed {
  background: linear-gradient(90deg, #10b981, #059669);
}

.progress-segment.failed {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ==========================================================================
   Toolbar & Filters
   ========================================================================== */
.toolbar-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.75rem 2.5rem 0.75rem 2.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
}

.search-box input:focus {
  background: white;
  border-color: var(--brand-ocean);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.btn-clear {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.9rem;
  border-radius: 50%;
}

.btn-clear:hover {
  color: var(--text-main);
}

.filter-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-right: 0.35rem;
}

.filter-chip, .filter-chip-prio {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: #f8fafc;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover, .filter-chip-prio:hover {
  background: #f1f5f9;
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.filter-chip.active, .filter-chip-prio.active {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: white;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.filter-chip.chip-success.active {
  background: var(--status-passed);
  border-color: var(--status-passed);
  color: white;
}

.filter-chip.chip-danger.active {
  background: var(--status-failed);
  border-color: var(--status-failed);
  color: white;
}

.filter-chip-prio.prio-high.active {
  background: var(--prio-high);
  border-color: var(--prio-high);
  color: white;
}

.accordion-toggles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.divider {
  color: var(--border-light);
}

/* ==========================================================================
   Accordion Sections & Cards
   ========================================================================== */
.sections-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.section-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Section Header (Clickable Accordion Trigger) */
.section-header {
  padding: 1.25rem 1.5rem;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  border-bottom: 1px solid transparent;
}

.section-card.open .section-header {
  border-bottom-color: var(--border-light);
  background: #fafcff;
}

.section-header:hover {
  background: #f8fafc;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #f0f9ff;
  color: var(--brand-ocean);
  border: 1px solid rgba(2, 132, 199, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.section-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Progress mini status in section header */
.section-stats-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.mini-badge.passed {
  background: var(--status-passed-bg);
  color: #065f46;
  border: 1px solid var(--status-passed-border);
}

.mini-badge.failed {
  background: var(--status-failed-bg);
  color: #991b1b;
  border: 1px solid var(--status-failed-border);
}

.mini-badge.total {
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.section-chevron {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.section-card.open .section-chevron {
  transform: rotate(180deg);
}

/* Accordion Body */
.section-body {
  display: none;
  padding: 1.5rem;
  background: #fafcff;
}

.section-card.open .section-body {
  display: block;
}

/* Category Subheader */
.category-group {
  margin-bottom: 1.75rem;
}

.category-group:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #e2e8f0;
}

.category-title {
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-ocean);
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  background: #e2e8f0;
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Test Case Item Card
   ========================================================================== */
.testcase-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.testcase-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--status-pending);
  transition: all var(--transition-fast);
}

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

/* Card Status Variations */
.testcase-card.status-passed {
  border-left-color: var(--status-passed);
  background: #ffffff;
}

.testcase-card.status-failed {
  border-left-color: var(--status-failed);
  background: #fffafa;
  border-color: #fed7d7;
}

/* Top Meta Row */
.tc-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.tc-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tc-id-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  background: #f1f5f9;
  color: var(--brand-navy);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.tc-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid #bbf7d0;
}

.tc-prio-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.tc-prio-badge.High {
  background: var(--prio-high-bg);
  color: var(--prio-high);
  border: 1px solid var(--prio-high-border);
}

.tc-prio-badge.Medium {
  background: var(--prio-med-bg);
  color: #b45309;
  border: 1px solid var(--prio-med-border);
}

.tc-prio-badge.Low {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.tc-status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tc-status-badge.pending {
  background: #f1f5f9;
  color: var(--status-pending);
  border: 1px solid var(--border-subtle);
}

.tc-status-badge.passed {
  background: var(--status-passed-bg);
  color: #065f46;
  border: 1px solid var(--status-passed-border);
}

.tc-status-badge.failed {
  background: var(--status-failed-bg);
  color: #991b1b;
  border: 1px solid var(--status-failed-border);
}

/* Title */
.tc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

/* Precondition & Steps & Expected */
.tc-details-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.tc-block {
  font-size: 0.86rem;
  line-height: 1.5;
}

.tc-block-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
}

.tc-precondition {
  background: #f8fafc;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border-subtle);
  color: var(--text-secondary);
}

.tc-steps-list {
  padding-left: 1.35rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tc-steps-list li {
  padding-left: 0.25rem;
}

.tc-expected {
  background: #f0fdf4;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid #dcfce7;
  color: #14532d;
  white-space: pre-line;
}

/* Action Bar */
.tc-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
}

.tc-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-tc-action {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-tc-action:hover {
  background: #f8fafc;
  color: var(--text-main);
}

.btn-tc-action.action-pass:hover,
.testcase-card.status-passed .btn-tc-action.action-pass {
  background: var(--status-passed-bg);
  border-color: var(--status-passed-border);
  color: #065f46;
  font-weight: 700;
}

.btn-tc-action.action-fail:hover,
.testcase-card.status-failed .btn-tc-action.action-fail {
  background: var(--status-failed-bg);
  border-color: var(--status-failed-border);
  color: #991b1b;
  font-weight: 700;
}

.btn-tc-action.action-comment {
  position: relative;
}

.btn-tc-action.has-comment {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.comment-badge-count {
  font-size: 0.68rem;
  background: #f59e0b;
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  margin-left: 0.2rem;
}

.tc-timestamp {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Comment Box (Inline Bug Report Area) */
.tc-comment-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: fadeIn 0.2s ease;
}

.tc-comment-box.hidden {
  display: none;
}

.tc-comment-box.is-general-note {
  background: #f8fafc;
  border-color: var(--border-light);
}

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

.comment-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tc-comment-box.is-general-note .comment-label {
  color: var(--text-secondary);
}

.comment-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.86rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text-main);
  resize: vertical;
  min-height: 60px;
  outline: none;
}

.tc-comment-box.is-general-note .comment-textarea {
  border-color: var(--border-light);
}

.comment-textarea:focus {
  border-color: var(--status-failed);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.comment-footer-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-small {
  max-width: 440px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  border-radius: 4px;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.flex-1 { flex: 1; min-width: 180px; }
.flex-small { width: 130px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  background: white;
  border-color: var(--brand-ocean);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

textarea.form-control {
  resize: vertical;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-danger {
  background: var(--status-failed);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.import-feedback {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
}

.import-feedback.success {
  background: var(--status-passed-bg);
  color: #065f46;
  border: 1px solid var(--status-passed-border);
}

.import-feedback.error {
  background: var(--status-failed-bg);
  color: #991b1b;
  border: 1px solid var(--status-failed-border);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--brand-navy);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 300;
  animation: slideUp 0.25s ease;
}

.toast.hidden {
  display: none;
}

.toast-icon {
  color: var(--status-passed);
  font-weight: 800;
}

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

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.35rem;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header-right {
    width: 100%;
    justify-content: space-between;
  }
}
