/* ============================================================================
   Clickable doc link + session overlay (appended to this file)
   ========================================================================== */
.cdcost-doc-link {
  color: #1E6332;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1.5px dashed #1E6332;
  cursor: pointer;
  padding-bottom: 1px;
}
.cdcost-doc-link:hover { color: #214A3E; border-bottom-style: solid; }
.cdcost-num-muted { color: #c7c3bd; font-weight: 600; }
.cdcost-num-val { cursor: help; }
.cdcost-section-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: #8b8580;
  margin-left: 8px;
}

/* Session overlay */
.cdcost-session-overlay {
  position: fixed;
  inset: 0;
  z-index: 10090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cdcost-session-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 25, 0.7);
  backdrop-filter: blur(3px);
}
.cdcost-session-dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.cdcost-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1E6332, #2F8542);
  color: #fff;
}
.cdcost-session-title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.cdcost-session-close {
  background: transparent;
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
}
.cdcost-session-close:hover { background: rgba(255, 255, 255, 0.18); }
.cdcost-session-body { flex: 1; overflow-y: auto; padding: 18px; background: #fafaf7; }
.cdcost-loading, .cdcost-error {
  text-align: center;
  padding: 40px 20px;
  color: #475453;
}
.cdcost-error { color: #dc2626; }

.cdcost-sess-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 8px;
}
.cdcost-sess-stat {
  padding: 6px 8px;
}
.cdcost-sess-stat-label {
  font-size: 0.65rem;
  color: #8b8580;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 2px;
}
.cdcost-sess-stat-value {
  font-size: 0.9rem;
  color: #231F20;
  font-weight: 700;
}

.cdcost-sess-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e1da;
  margin-bottom: 14px;
}
.cdcost-sess-tab {
  background: transparent;
  border: none;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475453;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cdcost-sess-tab:hover { color: #1E6332; }
.cdcost-sess-tab-active {
  color: #1E6332;
  border-bottom-color: #1E6332;
}
.cdcost-sess-pane { background: transparent; }

.cdcost-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.cdcost-doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 6px;
}
.cdcost-doc-icon {
  font-size: 1.4rem;
  color: #1E6332;
  width: 36px;
  text-align: center;
}
.cdcost-doc-info {
  flex: 1;
  min-width: 0;
}
.cdcost-doc-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #231F20;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cdcost-doc-meta {
  font-size: 0.7rem;
  color: #8b8580;
}
.cdcost-doc-view {
  background: #fff;
  color: #1E6332;
  border: 1px solid #1E6332;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cdcost-doc-view:hover { background: #F4F0E9; }

.cdcost-sess-section {
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}
.cdcost-sess-section h4 {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: #1E6332;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 6px;
  border-bottom: 1px solid #eeeae2;
}
.cdcost-sess-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.cdcost-sess-field {
  padding: 6px 8px;
  background: #fafaf7;
  border-radius: 4px;
}
.cdcost-sess-field-label {
  font-size: 0.62rem;
  color: #8b8580;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 2px;
}
.cdcost-sess-field-value {
  font-size: 0.82rem;
  color: #231F20;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}
.cdcost-sess-conf {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font-family: inherit;
}
.cdcost-sess-conf-high { background: #d4edda; color: #155724; }
.cdcost-sess-conf-med  { background: #fff3cd; color: #856404; }
.cdcost-sess-conf-low  { background: #f8d7da; color: #721c24; }

.cdcost-sess-raw {
  background: #1a1a1a;
  color: #c9e8d3;
  padding: 12px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.76rem;
  line-height: 1.45;
  overflow: auto;
  max-height: 60vh;
  margin: 0;
}

.cdcost-sess-qa {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cdcost-sess-qa-ai, .cdcost-sess-qa-user {
  padding: 10px 12px;
  border-radius: 8px;
  max-width: 80%;
}
.cdcost-sess-qa-ai {
  background: #F4F0E9;
  border-left: 3px solid #1E6332;
  align-self: flex-start;
}
.cdcost-sess-qa-user {
  background: #e8f0ea;
  border-left: 3px solid #2F8542;
  align-self: flex-end;
}
.cdcost-sess-qa-role {
  font-size: 0.65rem;
  font-weight: 800;
  color: #8b8580;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.cdcost-sess-q { font-size: 0.82rem; margin-bottom: 4px; color: #231F20; }

.cdcost-empty {
  text-align: center;
  padding: 30px 20px;
  color: #8b8580;
  font-style: italic;
  font-size: 0.85rem;
}

/* ============================================================================
   Claim Drop Cost Dashboard — HUB Settings tab
   All classes prefixed .cdcost- to avoid collisions.
   ============================================================================ */

.cdcost-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #F4F0E9;
  border-radius: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.cdcost-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cdcost-period-btns {
  display: flex;
  gap: 4px;
  background: #fff;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #d4cfc5;
}
.cdcost-period-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475453;
  cursor: pointer;
  transition: all 0.12s ease;
}
.cdcost-period-btn:hover { background: #F4F0E9; }
.cdcost-period-btn.active {
  background: #1E6332;
  color: #fff;
}
.cdcost-refresh-btn {
  background: #fff;
  border: 1px solid #d4cfc5;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1E6332;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cdcost-refresh-btn:hover { background: #F4F0E9; }
.cdcost-meta {
  font-size: 0.78rem;
  color: #8b8580;
}

.cdcost-loading,
.cdcost-error {
  padding: 40px 20px;
  text-align: center;
  color: #475453;
  font-size: 0.9rem;
}
.cdcost-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 10px;
}

/* KPI grid */
.cdcost-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.cdcost-kpi {
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 10px;
  padding: 16px 18px;
  text-align: center;
}
.cdcost-kpi-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #1E6332;
  line-height: 1.1;
  margin-bottom: 4px;
}
.cdcost-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475453;
}

/* Budget gauge */
.cdcost-budget-card {
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.cdcost-budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.cdcost-budget-title {
  font-weight: 700;
  color: #214A3E;
  font-size: 0.9rem;
}
.cdcost-budget-title i { color: #C19A6B; margin-right: 6px; }
.cdcost-budget-value {
  font-size: 0.88rem;
  color: #475453;
}
.cdcost-budget-value strong {
  color: #1E6332;
  font-size: 1.05rem;
}
.cdcost-budget-bar {
  width: 100%;
  height: 14px;
  background: #F4F0E9;
  border-radius: 7px;
  overflow: hidden;
}
.cdcost-budget-fill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cdcost-budget-footer {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #8b8580;
}

/* Sections */
.cdcost-section {
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.cdcost-section h3 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1E6332;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cdcost-empty {
  color: #8b8580;
  font-style: italic;
  font-size: 0.85rem;
  margin: 0;
}

/* Status chips */
.cdcost-status-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cdcost-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fafaf8;
  border: 1px solid #e5e1da;
  border-radius: 20px;
}
.cdcost-status-count {
  font-weight: 800;
  font-size: 1.05rem;
  color: #1E6332;
}
.cdcost-status-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475453;
  text-transform: capitalize;
}
.cdcost-status-submitted .cdcost-status-count { color: #2F8542; }
.cdcost-status-failed .cdcost-status-count,
.cdcost-status-cancelled .cdcost-status-count,
.cdcost-status-expired .cdcost-status-count { color: #dc2626; }
.cdcost-status-qa .cdcost-status-count,
.cdcost-status-analyzing .cdcost-status-count,
.cdcost-status-uploading .cdcost-status-count,
.cdcost-status-summary .cdcost-status-count { color: #f59e0b; }

/* Daily chart — clean, no horizontal scrollbar, sparse-friendly labels */
.cdcost-chart {
  /* container */
}
.cdcost-chart-inner {
  display: flex;
  gap: 3px;
  height: 200px;
  align-items: flex-end;
  padding: 16px 0 28px 0;     /* room for rotated labels below bars */
  border-bottom: 1px solid #e5e1da;
}
.cdcost-bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  position: relative;
}
.cdcost-bar-val {
  font-size: 0.6rem;
  color: #1E6332;
  font-weight: 700;
  margin-bottom: 3px;
  min-height: 10px;
  white-space: nowrap;
  pointer-events: none;
}
.cdcost-bar {
  width: 100%;
  max-width: 22px;
  background: linear-gradient(180deg, #2F8542, #1E6332);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: background 0.15s ease;
}
.cdcost-bar-empty {
  background: #e5e1da;
  min-height: 2px;
  height: 2px;
  opacity: 0.6;
}
.cdcost-bar-col:hover .cdcost-bar {
  background: linear-gradient(180deg, #3aa050, #214A3E);
}

/* Labels sit BELOW the axis line — no absolute positioning, no overlap */
.cdcost-bar-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  transform-origin: center top;
  font-size: 0.62rem;
  color: #8b8580;
  white-space: nowrap;
  font-weight: 500;
}
/* Hide overlapping labels when too many days — show every Nth */
.cdcost-bar-col.cdcost-label-hidden .cdcost-bar-label {
  display: none;
}

/* Tables */
.cdcost-table-wrap {
  overflow-x: auto;
}
.cdcost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.cdcost-table th,
.cdcost-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e1da;
  vertical-align: top;
}
.cdcost-table th {
  background: #F4F0E9;
  font-size: 0.72rem;
  font-weight: 700;
  color: #214A3E;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cdcost-table tr:last-child td {
  border-bottom: none;
}
.cdcost-table tr:hover td {
  background: #fafaf8;
}
.cdcost-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}
.cdcost-table-recent th,
.cdcost-table-recent td {
  font-size: 0.78rem;
  padding: 8px 10px;
}

.cdcost-table a {
  color: #1E6332;
  font-weight: 600;
  text-decoration: none;
}
.cdcost-table a:hover {
  text-decoration: underline;
}

/* Session status pill (in recent table) */
.cdcost-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #e5e5e5;
  color: #475453;
}
.cdcost-pill-submitted { background: #d1fae5; color: #065f46; }
.cdcost-pill-failed,
.cdcost-pill-cancelled,
.cdcost-pill-expired  { background: #fee2e2; color: #991b1b; }
.cdcost-pill-qa,
.cdcost-pill-analyzing,
.cdcost-pill-uploading,
.cdcost-pill-summary   { background: #fef3c7; color: #92400e; }

/* ============================================================================
   Source split cards + funnel + source pills (v40)
   ========================================================================== */
.cdcost-section-sub {
  font-size: 0.78rem;
  color: #8b8580;
  margin: 0 0 12px 0;
  line-height: 1.45;
}
.cdcost-source-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) { .cdcost-source-grid { grid-template-columns: 1fr; } }

.cdcost-source-card {
  background: #fff;
  border: 1px solid #e5e1da;
  border-radius: 8px;
  overflow: hidden;
}
.cdcost-source-head {
  padding: 10px 14px;
  background: #fafaf7;
  border-bottom: 3px solid;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.cdcost-source-head strong { flex: 1; }
.cdcost-source-count {
  font-size: 0.72rem;
  color: #8b8580;
  font-weight: 600;
}
.cdcost-source-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1px;
  background: #e5e1da;
}
.cdcost-src-stat {
  background: #fff;
  padding: 10px 12px;
}
.cdcost-src-stat-label {
  font-size: 0.62rem;
  color: #8b8580;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 2px;
}
.cdcost-src-stat-value {
  font-size: 0.9rem;
  color: #231F20;
  font-weight: 800;
}

/* Funnel */
.cdcost-funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cdcost-funnel-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cdcost-funnel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #231F20;
}
.cdcost-funnel-label i { color: #1E6332; width: 18px; }
.cdcost-funnel-drop {
  margin-left: auto;
  font-size: 0.7rem;
  color: #8b8580;
  font-weight: 600;
  background: #fafaf7;
  padding: 2px 8px;
  border-radius: 10px;
}
.cdcost-funnel-bar-wrap {
  height: 30px;
  background: #f4f0e9;
  border-radius: 6px;
  overflow: hidden;
}
.cdcost-funnel-bar {
  height: 100%;
  background: linear-gradient(90deg, #1E6332, #2F8542);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  min-width: 40px;
  transition: width 0.4s ease;
}
.cdcost-funnel-bar-val {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Source pill in Recent table */
.cdcost-src-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cdcost-src-pill-production { background: #d4edda; color: #155724; }
.cdcost-src-pill-lab        { background: #f4e4cf; color: #6b4a28; }
.cdcost-src-pill-unknown    { background: #e5e1da; color: #475453; }
