/* ── Card (Matches Premium ChartCard wrapper) ────────────────────────── */
.twl-card {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.12);
  height: 500px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.10), 0 1px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.twl-card:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ── Header (Matches ChartCard header design) ────────────────────────── */
.twl-header {
  display: flex;
  align-items: center;
  padding: 18px 24px 16px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.04) 100%);
  flex-shrink: 0;
}

.twl-title {
  color: #1E293B;
  font-size: 16px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ── Table Wrapper with padding ──────────────────────────────────────── */
.twl-table-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  margin: 12px 24px;
  background: #FAFBFF;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.08);
}

.twl-table {
  width: 100%;
  border-collapse: collapse;
}

.twl-th {
  color: #64748B;
  font-size: 11px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  padding: 10px;
  border-bottom: 1.5px solid rgba(99, 102, 241, 0.08);
  position: sticky;
  top: 0;
  background: #FAFBFF;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.twl-row {
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(99, 102, 241, 0.04);
}

.twl-row:hover {
  background: rgba(99, 102, 241, 0.04);
}

.twl-td {
  padding: 12px 10px;
  vertical-align: middle;
}

/* ── Column widths ────────────────────────────────────────────────────── */
.name-column   { width: 28%; }
.progress-column { width: 56%; }
.count-column  { width: 16%; }

/* ── Name ─────────────────────────────────────────────────────────────── */
.twl-name {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #1E293B;
}

/* ── Total badge ──────────────────────────────────────────────────────── */
.twl-total-badge {
  display: inline-block;
  background: #F1F5F9;
  color: #475569;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Bar wrapper (position anchor for tooltip) ────────────────────────── */
.twl-bar-wrapper {
  position: relative;
  display: block;
}

/* ── Bar container ────────────────────────────────────────────────────── */
.bar-container {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  background: #F1F5F9;
  width: 100%;
}

/* ── Segments (using modern soft cohesive colors matching chartTokens) ── */
.bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s ease;
}

.bar:hover {
  filter: brightness(0.92);
}

.bar-label {
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  white-space: nowrap;
  padding: 0 4px;
}

/* Soft, cohesive flat colors to match dashboard palette */
.accepted      { background-color: #10B981; } /* Softer modern success green */
.rejected      { background-color: #EF4444; } /* Cohesive red */
.not-responded { background-color: #94A3B8; } /* Slate grey/blue */
.answered      { background-color: #3B82F6; } /* Softer blue */
.assigned      { background-color: #6366F1; } /* Indigo primary */

/* ── Tooltip ──────────────────────────────────────────────────────────── */
.audit-tooltip {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #0F172A;
  color: #F8FAFC;
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 170px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 11px;
  pointer-events: none;
  animation: tooltipIn 0.15s cubic-bezier(0, 0, 0.2, 1);
}

.audit-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top: 0;
  border-bottom-color: #0F172A;
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.audit-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.audit-tooltip-row:last-child {
  margin-bottom: 0;
}

.audit-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.accepted-dot  { background: #10B981; }
.rejected-dot  { background: #EF4444; }
.pending-dot   { background: #94A3B8; }

.audit-tooltip-label {
  flex: 1;
  color: #94A3B8;
}

.audit-tooltip-value {
  font-weight: 700;
  color: #ffffff;
}

.audit-tooltip-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 0;
}

.total-row .audit-tooltip-label {
  color: #ffffff;
  font-weight: 600;
}

/* ── Legend ───────────────────────────────────────────────────────────── */
.legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px 16px;
  flex-shrink: 0;
  border-top: 1px solid #F1F5F9;
  background: #FAFCFF;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.legend-item.inactive {
  opacity: 0.35;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-text {
  color: #475569;
  font-size: 11px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 500;
}

/* ── Empty state ─────────────────────────────────────────────────────── */
.twl-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.twl-empty-text {
  color: #94A3B8;
  font-size: 13px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Scrollbar styling ───────────────────────────────────────────────── */
.twl-table-wrapper::-webkit-scrollbar {
  width: 4px;
}
.twl-table-wrapper::-webkit-scrollbar-track {
  background: #F8FAFC;
}
.twl-table-wrapper::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

/* ── Legacy compat ───────────────────────────────────────────────────── */
.id-column     { width: 10%; }
.scrollable-table { height: 70%; overflow-y: auto; }
.count-container {
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background-color: #DCEEEF;
  color: #3F88A5;
  text-align: right;
  padding: 5px;
}