/* ============================================
   MYCFO Sprint 4 — Projects Styles
   ============================================ */

/* ── Summary Strip ──────────────────────────── */
.proj-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.proj-summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
  cursor: pointer;
}

.proj-summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.proj-summary-card.blue::before   { background: var(--color-brand-blue); }
.proj-summary-card.green::before  { background: var(--color-success); }
.proj-summary-card.orange::before { background: var(--color-warning); }
.proj-summary-card.purple::before { background: #7c3aed; }
.proj-summary-card.gray::before   { background: var(--color-text-tertiary); }

.proj-summary-card:hover { box-shadow: var(--shadow-sm); }
.proj-summary-card.active-filter { box-shadow: var(--shadow-sm); border-color: var(--color-brand-blue); }

.proj-summary-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.proj-summary-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  line-height: 1;
  margin-bottom: 3px;
}

.proj-summary-sub {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

/* ── Project Card ───────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.proj-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proj-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
}

.proj-card.type-development::before { background: linear-gradient(90deg,#7c3aed,#a78bfa); }
.proj-card.type-operation::before   { background: linear-gradient(90deg,#2563eb,#60a5fa); }
.proj-card.type-construction::before{ background: linear-gradient(90deg,#d97706,#fbbf24); }
.proj-card.type-solar::before       { background: linear-gradient(90deg,#f59e0b,#fde68a); }
.proj-card.type-oem::before         { background: linear-gradient(90deg,#059669,#6ee7b7); }
.proj-card.type-rd::before          { background: linear-gradient(90deg,#db2777,#f9a8d4); }
.proj-card.type-patent::before      { background: linear-gradient(90deg,#4338ca,#818cf8); }
.proj-card.type-brand::before       { background: linear-gradient(90deg,#e11d48,#fda4af); }
.proj-card.type-investment::before  { background: linear-gradient(90deg,#0d9488,#5eead4); }
.proj-card.type-other::before       { background: linear-gradient(90deg,#6b7280,#d1d5db); }

.proj-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-text-tertiary);
}

.proj-card.status-archived,
.proj-card.status-cancelled {
  opacity: 0.6;
}

.proj-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-top: 4px;
}

.proj-card-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.proj-card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.proj-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.proj-card-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Budget progress */
.proj-budget-bar {
  margin-bottom: 12px;
}

.proj-budget-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-bottom: 4px;
}

.proj-budget-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.proj-progress-track {
  height: 5px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.proj-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.proj-progress-fill.green      { background: var(--color-success); }
.proj-progress-fill.orange     { background: var(--color-warning); }
.proj-progress-fill.red        { background: var(--color-danger); }
.proj-progress-fill.blue       { background: var(--color-brand-blue); }
.proj-progress-fill.fill-ok    { background: var(--color-success); }
.proj-progress-fill.fill-warning{ background: var(--color-warning); }
.proj-progress-fill.fill-danger { background: var(--color-danger); }

.proj-budget-spent {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-top: 3px;
}

/* Status text colors */
.text-ok      { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger  { color: var(--color-danger)  !important; }

.proj-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.proj-card-entity {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.proj-entity-dot {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.proj-card-meta {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.proj-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.proj-card:hover .proj-card-actions { opacity: 1; }

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.proj-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 3px;
  font-size: 10px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ── Project Detail ─────────────────────────── */
.proj-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.proj-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}

.proj-hero-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.proj-hero-info { flex: 1; }
.proj-hero-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.proj-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.proj-hero-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.proj-hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Stats row */
.proj-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.proj-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: center;
}

.proj-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 3px;
}

.proj-stat-value.positive { color: var(--color-success); }
.proj-stat-value.negative { color: var(--color-danger); }
.proj-stat-value.warning  { color: var(--color-warning); }

.proj-stat-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ── Timeline ───────────────────────────────── */
.proj-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proj-timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.proj-timeline-item:last-child { border-bottom: none; }

.proj-timeline-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.proj-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
  margin-top: 4px;
}

.proj-timeline-dot.dot-green  { border-color: var(--color-success); background: var(--color-success); }
.proj-timeline-dot.dot-blue   { border-color: var(--color-brand-blue); background: var(--color-brand-blue); }
.proj-timeline-dot.dot-orange { border-color: var(--color-warning); background: var(--color-warning); }
.proj-timeline-dot.dot-purple { border-color: #7c3aed; background: #7c3aed; }
.proj-timeline-dot.dot-gray   { border-color: var(--color-text-tertiary); background: transparent; }

.proj-timeline-line {
  flex: 1;
  width: 1px;
  background: var(--color-border-light);
  margin-top: 4px;
}

.proj-timeline-content { flex: 1; }
.proj-timeline-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.proj-timeline-date {
  font-size: 11px;
  color: var(--color-text-tertiary);
}

/* ── Modal ──────────────────────────────────── */
.proj-modal-wide { max-width: 640px; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .proj-summary-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .proj-summary-strip { grid-template-columns: 1fr 1fr; }
  .proj-stats-row { grid-template-columns: 1fr 1fr; }
  .proj-hero { flex-direction: column; }
}
@media (max-width: 640px) {
  .proj-grid { grid-template-columns: 1fr; }
  .proj-summary-strip { grid-template-columns: 1fr 1fr; }
}

/* ── Summary card status colors ────────────────── */
.proj-summary-card.all::before      { background: var(--color-text-secondary); }
.proj-summary-card.active::before   { background: var(--color-success); }
.proj-summary-card.planning::before { background: var(--color-brand-blue); }
.proj-summary-card.hold::before     { background: var(--color-warning); }
.proj-summary-card.completed::before{ background: #7c3aed; }

/* ── Toast ──────────────────────────────────── */
.proj-toast {
  position: fixed;
  bottom: 28px; right: 28px;
  min-width: 280px; max-width: 420px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  background: #1e293b; color: #f8fafc;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(12px);
  transition: all .3s ease;
  pointer-events: none;
  z-index: 9999;
  border-left: 4px solid #3b82f6;
}
.proj-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Timeline description ───────────────────── */
.proj-timeline-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-top: 2px;
}

.proj-timeline-future { opacity: 0.5; }

/* ── Overview content ───────────────────────── */
.proj-overview-content { padding: 4px 0; }
