/* Combine Portfolio — Trendlyne-dense shell (layout-agnostic under .pc-root) */
.pc-root {
  --pc-bg: #fff;
  --pc-muted: #6b7280;
  --pc-border: #e5e7eb;
  --pc-surface: #f8fafc;
  --pc-text: #111827;
  --pc-pos: #16a34a;
  --pc-neg: #dc2626;
  --pc-accent: #ff6600;
  --pc-blue: #2563eb;
  --pc-row: 40px;
  --pc-font: 13px;
  color: var(--pc-text);
}

.pc-demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 6px;
}

.pc-kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  background: var(--pc-bg);
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.pc-kpi-item {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.85rem 1.1rem;
  min-width: 0;
}

.pc-kpi-meta {
  flex: 0 1 160px;
}

.pc-kpi-sep {
  width: 1px;
  background: var(--pc-border);
  align-self: stretch;
  flex: 0 0 1px;
}

.pc-kpi-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pc-muted);
  margin-bottom: 0.2rem;
}

.pc-kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.pc-kpi-value.pos { color: var(--pc-pos); }
.pc-kpi-value.neg { color: var(--pc-neg); }
.pc-kpi-count { font-size: 1.15rem; }

.pc-kpi-sub {
  font-size: 0.75rem;
  min-height: 1em;
  font-variant-numeric: tabular-nums;
}
.pc-kpi-sub.pos { color: var(--pc-pos); }
.pc-kpi-sub.neg { color: var(--pc-neg); }

.pc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--pc-pos);
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  width: fit-content;
}

.pc-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pc-pos);
  animation: pcPulse 1.4s ease-in-out infinite;
}

@keyframes pcPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-live-dot { animation: none; }
}

.pc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.pc-toolbar-left,
.pc-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pc-search {
  position: relative;
  min-width: 180px;
}

.pc-search i {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pc-muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.pc-search .form-control {
  padding-left: 1.85rem;
  border-color: var(--pc-border);
  font-size: var(--pc-font);
}

.pc-toolbar .form-select {
  width: auto;
  min-width: 130px;
  border-color: var(--pc-border);
  font-size: var(--pc-font);
}

.pc-row-count {
  font-size: 0.75rem;
}

.pc-btn-sync {
  border: 1px solid var(--pc-border);
  background: var(--pc-bg);
  color: var(--pc-text);
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.pc-btn-sync:hover {
  background: #fff4ee;
  border-color: #ffb380;
  color: var(--pc-accent);
}

.pc-table-wrap {
  background: var(--pc-bg);
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
}

.pc-loading,
.pc-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--pc-muted);
}

.pc-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--pc-font);
  font-variant-numeric: tabular-nums;
}

.pc-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pc-surface);
  border-bottom: 1px solid var(--pc-border);
  color: var(--pc-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.65rem 0.75rem;
  white-space: nowrap;
}

.pc-table tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  height: var(--pc-row);
}

.pc-table tbody tr.pc-symbol-row {
  cursor: default;
  transition: background 150ms ease;
}

.pc-table tbody tr.pc-symbol-row:hover {
  background: #fffaf6;
}

.pc-col-toggle {
  width: 36px;
  padding-left: 0.5rem !important;
  padding-right: 0.25rem !important;
}

.pc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid var(--pc-border);
  border-radius: 4px;
  background: var(--pc-bg);
  color: var(--pc-blue);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.pc-toggle:hover,
.pc-toggle:focus-visible {
  background: #eff6ff;
  border-color: #93c5fd;
  outline: none;
}

.pc-stock-sym {
  font-weight: 700;
  color: var(--pc-text);
}

.pc-stock-meta {
  font-size: 0.68rem;
  color: var(--pc-muted);
  line-height: 1.3;
}

.pc-broker-row td {
  background: var(--pc-surface);
  font-size: 0.8rem;
}

.pc-broker-row td:nth-child(2) {
  border-left: 3px solid #cbd5e1;
  padding-left: 1rem;
}

.pc-broker-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}

.pc-broker-badge.zerodha { background: #dbeafe; color: #1d4ed8; }
.pc-broker-badge.groww { background: #dcfce7; color: #15803d; }
.pc-broker-badge.paisa { background: #fef3c7; color: #b45309; }
.pc-broker-badge.angel { background: #ede9fe; color: #6d28d9; }
.pc-broker-badge.other { background: #f1f5f9; color: #475569; }

.pc-pos { color: var(--pc-pos) !important; font-weight: 600; }
.pc-neg { color: var(--pc-neg) !important; font-weight: 600; }

.pc-flash-up { animation: pcFlashUp 0.9s ease; }
.pc-flash-down { animation: pcFlashDown 0.9s ease; }

@keyframes pcFlashUp {
  0% { background: rgba(22, 163, 74, 0.25); }
  100% { background: transparent; }
}
@keyframes pcFlashDown {
  0% { background: rgba(220, 38, 38, 0.2); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-flash-up, .pc-flash-down { animation: none; }
}

/* Marketing host tweaks */
.rs-mkt-portfolio .pc-root {
  margin-bottom: 1.5rem;
}

.rs-combine-hero {
  position: relative;
  padding: 2rem 0 1.25rem;
  background: linear-gradient(180deg, #fff4ee 0%, #ffffff 100%);
  overflow: hidden;
}

.rs-combine-hero .rs-hero-pattern {
  opacity: 0.35;
}

/* AppLayout host */
.rs-combine-app .pc-root {
  margin-top: 0.25rem;
}

@media (max-width: 767.98px) {
  .pc-kpi-item { flex: 1 1 45%; padding: 0.75rem; }
  .pc-kpi-value { font-size: 1rem; }
  .pc-table thead th,
  .pc-table tbody td { padding: 0.45rem 0.5rem; }
  .pc-search { min-width: 100%; flex: 1 1 100%; }
}
