/* ============================
   GLOBAL ANALYTICS TABLE STYLES
   ============================ */

/* Table Wrapper */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: white;
}

/* Base Table */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background-color: #fff;
}

/* Header Styling */
.analytics-table thead th {
  background: linear-gradient(135deg, #eef2ff, #dbeafe);
  color: #1f2937;
  padding: 14px 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  border-bottom: 2px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04), 0 2px 6px rgba(31, 41, 55, 0.08);
  border-radius: 6px 6px 0 0;
}

/* Body Cells */
.analytics-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ececec;
  vertical-align: middle;
}

.analytics-table td.total-cost-cell {
  text-align: center;
  vertical-align: middle;
}

/* Zebra Striping */
.analytics-table tbody tr:nth-child(even) {
  background: linear-gradient(180deg, #f9fbff 0%, #f4f7fb 100%);
}

/* Row Hover */
.analytics-table tbody tr:hover {
  background-color: #eef4ff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Numeric Styling */
.analytics-table td.numeric-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analytics-table td.amount-col {
  text-align: right;
  font-weight: 600;
  color: #2a4365;
}

.analytics-table td.hours-col {
  text-align: right;
  color: #1f2937;
}

/* Date Columns */
.analytics-table td.date-col {
  white-space: nowrap;
  color: #444;
}

/* Total Row */
.analytics-table tr.total-row td {
  font-weight: bold;
  background-color: #e0e7ff;
  border-top: 2px solid #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Cost Color Coding */
.analytics-table td.high-cost {
  color: #b91c1c;
  font-weight: 700;
}

.analytics-table td.med-cost {
  color: #d97706;
  font-weight: 700;
}

.analytics-table td.low-cost {
  color: #15803d;
  font-weight: 700;
}

/* Mini Bar Chart */
.analytics-table td .bar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.analytics-table td .bar-bg {
  position: relative;
  flex: 0 0 70px;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.analytics-table td .bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.analytics-table td .bar-value {
  min-width: 72px;
  text-align: right;
}


/* ============================
   CHAT UI ENHANCEMENTS (STYLE B)
   ============================ */

/* Fade-in animation */
.chat-fade {
  animation: fadeIn 0.35s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator dot wave */
.typing-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 14px;
  background: #f1f5f9;
  width: fit-content;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  animation: typingWave 1.1s infinite ease-in-out;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingWave {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%          { opacity: 1; transform: translateY(-4px); }
}

/* Speech bubble tails */
.bubble-tail-user {
  position: absolute;
  right: -6px;
  bottom: 10px;
  width: 12px;
  height: 12px;
  background: #f59e0b; /* amber-500 */
  clip-path: polygon(100% 50%, 0 0, 0 100%);
}

.bubble-tail-ai {
  position: absolute;
  left: -6px;
  bottom: 10px;
  width: 12px;
  height: 12px;
  background: #f1f5f9; /* slate-100 */
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
