@import "tailwindcss";
@config "../../../tailwind.config.js";

@source "../views/**/*.html.erb";
@source "../helpers/**/*.rb";
@source "../javascript/**/*.js";

@theme {
  --color-brand-50: #eff6ff;
  --color-brand-100: #dbeafe;
  --color-brand-500: #3b82f6;
  --color-brand-600: #2563eb;
  --color-brand-700: #1d4ed8;

  --font-sans: "Pretendard", sans-serif;
}

/* Force generation of these classes (safelist equivalent) */
.bg-brand-600 {
  background-color: var(--color-brand-600);
}

.text-brand-600 {
  color: var(--color-brand-600);
}

/* ═══════════════════════════════════════
   EXAWin Sales Dashboard
   ═══════════════════════════════════════ */
.exa-dashboard {
  padding: 20px 24px;
  max-width: 1400px;
}

/* KPI Cards Row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dash-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.2s, transform 0.15s;
}
.dash-kpi-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.dark .dash-kpi-card {
  background: #1e2a3a;
  border-color: #2d3d50;
}
.dash-kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
}
.dark .dash-kpi-value { color: #e8ecf1; }
.dash-kpi-label {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dark .dash-kpi-label { color: #9ca3af; }

/* Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* Rankings Row */
.dash-rankings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Card */
.dash-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.dark .dash-card {
  background: #1e2a3a;
  border-color: #2d3d50;
}
.dash-card-wide { min-height: 260px; }
.dash-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f3f4f6;
}
.dash-card-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dark .dash-card-header { border-color: #2d3d50; }
.dark .dash-card-header h3 { color: #c8d0da; }
.dash-card-body { padding: 16px 18px; }

/* Hot / Risk headers */
.dash-header-hot { border-left: 3px solid #10b981; }
.dash-header-risk { border-left: 3px solid #ef4444; }
.dash-badge-hot, .dash-badge-risk {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 500;
}
.dash-badge-hot { background: rgba(16,185,129,0.12); color: #059669; }
.dash-badge-risk { background: rgba(239,68,68,0.12); color: #dc2626; }
.dark .dash-badge-hot { background: rgba(16,185,129,0.2); color: #34d399; }
.dark .dash-badge-risk { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* Deal Items */
.dash-ranking-list { padding: 8px 18px; }
.dash-deal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.dash-deal-item:last-child { border-bottom: none; }
.dark .dash-deal-item { border-color: #2d3d50; }
.dash-deal-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}
.dark .dash-deal-name { color: #e8ecf1; }
.dash-deal-meta {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 2px;
}
.dash-deal-stats { display: flex; align-items: center; gap: 12px; }
.dash-pwin-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
}
.dash-pwin-hot { background: rgba(16,185,129,0.12); color: #059669; }
.dash-pwin-risk { background: rgba(239,68,68,0.12); color: #dc2626; }
.dark .dash-pwin-hot { background: rgba(16,185,129,0.2); color: #34d399; }
.dark .dash-pwin-risk { background: rgba(239,68,68,0.2); color: #fca5a5; }
.dash-deal-revenue {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  min-width: 70px;
  text-align: right;
}
.dash-silence-warn {
  color: #f59e0b;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.dash-empty {
  text-align: center;
  padding: 24px;
  color: #9ca3af;
  font-size: 0.85rem;
}

/* Activity Table */
.dash-activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dash-activity-table th {
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dark .dash-activity-table th { color: #9ca3af; border-color: #2d3d50; }
.dash-activity-table td {
  padding: 10px 10px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.dark .dash-activity-table td { color: #c8d0da; border-color: #2d3d50; }
.dash-activity-table tr:hover td { background: rgba(59,130,246,0.04); }
.dark .dash-activity-table tr:hover td { background: rgba(59,130,246,0.06); }
.dash-cell-date { font-weight: 600; white-space: nowrap; min-width: 50px; }
.dash-cell-summary { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-stage-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(59,130,246,0.08);
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 500;
}
.dark .dash-stage-tag { background: rgba(59,130,246,0.15); color: #93c5fd; }

/* Responsive */
@media (max-width: 1024px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-charts-row { grid-template-columns: 1fr; }
  .dash-rankings-row { grid-template-columns: 1fr; }
}