/* ============================================================
   /achizitii/firma și /achizitii/autoritate — profile pages
   Scoped la .achizitii-app (vine prin AchizitiiLayout)
   ============================================================ */

.achizitii-app .profile-header {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.achizitii-app .profile-header-flag-strip {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--stamp), #60A5FA);
}

.achizitii-app .profile-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--stamp-soft);
  color: var(--stamp);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}

.achizitii-app .profile-name {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 6px 0;
  word-break: break-word;
}
.achizitii-app .profile-subline {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--meta);
  align-items: center;
}
.achizitii-app .profile-subline .badge {
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px; font-weight: 500; color: var(--ink-soft);
}
.achizitii-app .profile-subline .badge-stamp { background: var(--stamp-soft); color: var(--stamp); border-color: rgba(37,99,235,0.2); }
.achizitii-app .profile-subline .badge-state { background: var(--state-soft); color: #047857; border-color: rgba(16,185,129,0.2); }
.achizitii-app .profile-subline .badge-signal { background: var(--signal-soft); color: var(--signal); border-color: rgba(180,83,9,0.2); }

.achizitii-app .profile-dossier {
  background: linear-gradient(180deg, #F8FAFC 0%, white 100%);
  border-left: 3px solid var(--stamp);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 14px; line-height: 1.6;
  color: var(--ink-soft);
}
.achizitii-app .profile-dossier strong { color: var(--ink); font-weight: 600; }

/* ===== KPI strip ===== */
.achizitii-app .profile-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.achizitii-app .profile-kpi {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.achizitii-app .profile-kpi-label {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--meta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.achizitii-app .profile-kpi-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.achizitii-app .profile-kpi-hint {
  font-size: 10.5px;
  color: var(--meta);
  margin-top: 2px;
}
.achizitii-app .profile-kpi[data-tone="ok"] { border-color: rgba(16,185,129,0.3); }
.achizitii-app .profile-kpi[data-tone="warn"] { border-color: rgba(245,158,11,0.4); background: linear-gradient(180deg, white 0%, rgba(254,243,199,0.3) 100%); }
.achizitii-app .profile-kpi[data-tone="risk"] { border-color: rgba(239,68,68,0.4); background: linear-gradient(180deg, white 0%, rgba(254,226,226,0.3) 100%); }
.achizitii-app .profile-kpi[data-tone="risk"] .profile-kpi-value { color: #B91C1C; }
.achizitii-app .profile-kpi[data-tone="warn"] .profile-kpi-value { color: var(--signal); }
.achizitii-app .profile-kpi[data-tone="ok"] .profile-kpi-value { color: #047857; }

/* ===== Tabs ===== */
.achizitii-app .profile-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.achizitii-app .profile-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border: none; background: transparent;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px; font-weight: 600;
  color: var(--meta);
  border-bottom: 2px solid transparent;
  cursor: pointer; transition: all 150ms ease;
  white-space: nowrap;
  text-decoration: none;
}
.achizitii-app .profile-tab:hover { color: var(--ink); }
.achizitii-app .profile-tab.is-active {
  color: var(--stamp);
  border-bottom-color: var(--stamp);
}
.achizitii-app .profile-tab-count {
  background: var(--rule-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px; font-weight: 700;
  color: var(--meta);
}
.achizitii-app .profile-tab.is-active .profile-tab-count {
  background: var(--stamp-soft); color: var(--stamp);
}

.achizitii-app .profile-section {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.achizitii-app .profile-section-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 12px 0;
  display: flex; align-items: center; gap: 8px;
}
.achizitii-app .profile-section-title-meta {
  font-size: 11px; color: var(--meta); font-weight: 500;
  margin-left: auto;
}

/* ===== Calendar heatmap ===== */
.achizitii-app .profile-heatmap {
  font-family: 'Inter', system-ui, sans-serif;
}
.achizitii-app .profile-heatmap-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px; gap: 12px; flex-wrap: wrap;
}
.achizitii-app .profile-heatmap-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700; font-size: 13px; color: var(--ink);
}
.achizitii-app .profile-heatmap-subtitle {
  font-size: 11.5px; color: var(--meta); margin-top: 2px;
}
.achizitii-app .profile-heatmap-legend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--meta);
}
.achizitii-app .profile-heatmap-legend-cell {
  display: inline-block;
  border-radius: 2px;
  border: 0.5px solid rgba(15,23,42,0.06);
}
.achizitii-app .profile-heatmap-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.achizitii-app .profile-heatmap-tip {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--rule-soft);
  border-radius: 8px;
  display: inline-block;
}

/* ===== County bars ===== */
.achizitii-app .profile-county-bars {
  display: flex; flex-direction: column;
}
.achizitii-app .profile-county-header {
  display: flex; justify-content: space-between;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 10.5px; font-weight: 700;
  color: var(--meta);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--rule);
}
.achizitii-app .profile-county-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  text-decoration: none; color: inherit;
  border-radius: 6px;
  transition: background 120ms;
}
.achizitii-app .profile-county-row:hover {
  background: var(--rule-soft);
}
.achizitii-app .profile-county-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.achizitii-app .profile-county-bar-track {
  height: 6px;
  background: var(--rule-soft);
  border-radius: 4px;
  overflow: hidden;
}
.achizitii-app .profile-county-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #93C5FD, var(--stamp));
  border-radius: 4px;
}
.achizitii-app .profile-county-value {
  font-size: 12px; font-weight: 600; color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.achizitii-app .profile-county-count {
  font-weight: 400; color: var(--meta);
}
.achizitii-app .profile-county-empty {
  font-size: 12.5px; color: var(--meta);
  padding: 12px; font-style: italic;
}

/* ===== Top counterparts list ===== */
.achizitii-app .profile-topcps {
  display: flex; flex-direction: column; gap: 0;
}
.achizitii-app .profile-topcp {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 120ms;
}
.achizitii-app .profile-topcp:last-child { border-bottom: none; }
.achizitii-app .profile-topcp:hover { background: var(--rule-soft); border-radius: 6px; }
.achizitii-app .profile-topcp-rank {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 700; color: var(--meta);
  width: 22px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.achizitii-app .profile-topcp-info { flex: 1; min-width: 0; }
.achizitii-app .profile-topcp-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.achizitii-app .profile-topcp-meta {
  font-size: 11px; color: var(--meta); margin-top: 2px;
}
.achizitii-app .profile-topcp-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700; color: var(--stamp);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* ===== Contracts list ===== */
.achizitii-app .profile-contract {
  display: block;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: all 150ms;
}
.achizitii-app .profile-contract:hover {
  border-color: var(--stamp);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 8px rgba(15,23,42,0.04);
}
.achizitii-app .profile-contract-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--meta);
  margin-bottom: 4px;
}
.achizitii-app .profile-contract-title {
  font-size: 14px; font-weight: 500; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.achizitii-app .profile-contract-bottom {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11.5px; color: var(--meta);
  margin-top: 4px;
}
.achizitii-app .profile-contract-cp {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.achizitii-app .profile-contract-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700; color: var(--stamp);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ===== Network graph ===== */
.achizitii-app .profile-network {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}
.achizitii-app .profile-network-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 12px;
}
.achizitii-app .profile-network-clear {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  color: var(--meta);
  cursor: pointer;
  transition: all 150ms;
}
.achizitii-app .profile-network-clear:hover {
  border-color: var(--stamp); color: var(--stamp);
}
.achizitii-app .profile-network-canvas-wrap {
  position: relative;
  width: 100%;
}
.achizitii-app .profile-network-svg {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(135deg, #FAFBFC 0%, #F1F5F9 100%);
  border-radius: 12px;
}
.achizitii-app .profile-network-detail {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--rule-soft);
  border-radius: 12px;
  border-left: 3px solid var(--stamp);
}
.achizitii-app .profile-network-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.achizitii-app .profile-network-detail-name {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-top: 2px;
}
.achizitii-app .profile-network-detail-name:hover { color: var(--stamp); }
.achizitii-app .profile-network-detail-sub {
  font-size: 11.5px;
  color: var(--meta);
  margin-top: 2px;
}
.achizitii-app .profile-network-detail-others {
  margin-top: 8px;
}
.achizitii-app .profile-network-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.achizitii-app .profile-network-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 120ms;
}
.achizitii-app .profile-network-detail-item:hover {
  border-color: var(--stamp);
  transform: translateY(-1px);
}
.achizitii-app .profile-network-detail-item-name {
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.achizitii-app .profile-network-detail-item-meta {
  font-size: 11px;
  color: var(--meta);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== Financial timeline ===== */
.achizitii-app .profile-fin {
  width: 100%;
}
.achizitii-app .profile-fin-empty {
  font-size: 13px; color: var(--meta);
  padding: 16px; font-style: italic; text-align: center;
}
.achizitii-app .profile-fin-grid {
  display: flex; flex-direction: column; gap: 16px;
}
.achizitii-app .profile-fin-row {
  display: grid;
  grid-template-columns: 180px repeat(auto-fit, minmax(70px, 1fr));
  gap: 4px;
  align-items: end;
}
.achizitii-app .profile-fin-row.profile-fin-axis {
  align-items: start;
  border-top: 1px solid var(--rule);
  padding-top: 6px;
}
.achizitii-app .profile-fin-label {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  padding: 0 8px 8px 0;
}
.achizitii-app .profile-fin-metric {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
}
.achizitii-app .profile-fin-sub {
  font-size: 10.5px;
  color: var(--meta);
  margin-top: 2px;
}
.achizitii-app .profile-fin-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.achizitii-app .profile-fin-bar {
  width: 100%;
  height: 60px;
  background: var(--rule-soft);
  border-radius: 6px 6px 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.achizitii-app .profile-fin-bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 1px;
  transition: height 220ms ease-out;
}
.achizitii-app .profile-fin-bar-ca {
  background: linear-gradient(180deg, #2563EB 0%, #1D4ED8 100%);
}
.achizitii-app .profile-fin-bar-profit {
  background: linear-gradient(180deg, #10B981 0%, #047857 100%);
}
.achizitii-app .profile-fin-bar-loss {
  background: linear-gradient(180deg, #EF4444 0%, #B91C1C 100%);
}
.achizitii-app .profile-fin-bar-sal {
  background: linear-gradient(180deg, #F59E0B 0%, #B45309 100%);
}
.achizitii-app .profile-fin-value {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.achizitii-app .profile-fin-value-loss { color: #B91C1C; }
.achizitii-app .profile-fin-year {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--meta);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.achizitii-app .profile-fin-source {
  font-size: 10.5px;
  color: var(--meta);
  margin-top: 12px;
  text-align: right;
  font-style: italic;
}

/* ===== Firm details panel (ONRC) ===== */
.achizitii-app .profile-firm-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: var(--rule-soft);
  border-radius: 12px;
  margin-bottom: 14px;
}
.achizitii-app .profile-firm-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.achizitii-app .profile-firm-meta-label {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--meta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.achizitii-app .profile-firm-meta-value {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}

.achizitii-app .profile-firm-admins {
  display: flex; flex-direction: column; gap: 6px;
}
.achizitii-app .profile-firm-admin {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 12.5px;
}
.achizitii-app .profile-firm-admin-name {
  font-weight: 500; color: var(--ink);
}
.achizitii-app .profile-firm-admin-role {
  font-size: 10.5px; color: var(--meta);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ===== External links bar ===== */
.achizitii-app .profile-external {
  background: var(--rule-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 12.5px;
}
.achizitii-app .profile-external-label {
  color: var(--meta); margin-bottom: 6px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.achizitii-app .profile-external-links {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.achizitii-app .profile-external-link {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: all 120ms;
}
.achizitii-app .profile-external-link:hover {
  border-color: var(--stamp);
  color: var(--stamp);
}
