* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #172033;
}

.container {
  width: min(1000px, calc(100% - 32px));
  margin: 40px auto 70px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: 32px;
}

header p {
  margin: 6px 0 0;
  color: #667085;
}

.badge {
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  padding: 7px 12px;
  background: white;
  font-size: 13px;
  font-weight: 700;
}

.card {
  background: white;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 24px;
  margin-top: 18px;
  box-shadow: 0 5px 20px rgba(16, 24, 40, .05);
}

h2 {
  margin-top: 0;
}

h3 {
  margin: 24px 0 8px;
  font-size: 15px;
}

.hint {
  color: #667085;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stats > div {
  padding: 15px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #f9fafb;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 24px;
}

.stats span {
  color: #667085;
  margin-top: 3px;
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: #172033;
  color: white;
  font: inherit;
  cursor: pointer;
}

.button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.button.secondary {
  background: #eef1f5;
  color: #172033;
}

.dropzone {
  min-height: 190px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  text-align: center;
}

.dropzone span {
  font-size: 32px;
}

.dropzone small,
.list {
  color: #667085;
}

.warning {
  margin: 20px 0;
  padding: 13px 15px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.status {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 9px;
  background: #f2f4f7;
  color: #475467;
}

.status.error {
  background: #fef3f2;
  color: #b42318;
}

.status.success {
  background: #ecfdf3;
  color: #027a48;
}

@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  header {
    align-items: flex-start;
  }
}



.notice {
  margin: 14px 0;
  padding: 13px 15px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #7c2d12;
}

.price-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #f9fafb;
}

.price-panel h3 {
  margin: 0 0 6px;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.price-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.price-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: white;
}

.price-panel button {
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}


.settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  gap: 12px;
  margin: 14px 0;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.settings-grid select {
  padding: 10px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: white;
  font: inherit;
}

.market-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.market-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.market-summary > div {
  padding: 14px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #f9fafb;
}

.market-summary strong,
.market-summary span {
  display: block;
}

.market-summary strong {
  font-size: 21px;
}

.market-summary span {
  color: #667085;
  font-size: 13px;
  margin-top: 3px;
}

@media (max-width: 800px) {
  .market-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portfolio-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.portfolio-kpis > div {
  padding: 16px;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  background: #f9fafb;
}

.portfolio-kpis strong,
.portfolio-kpis span {
  display: block;
}

.portfolio-kpis strong {
  font-size: 20px;
}

.portfolio-kpis span {
  margin-top: 5px;
  color: #667085;
  font-size: 13px;
}

.portfolio-kpis .positive { background: #ecfdf3; border-color: #abefc6; }
.portfolio-kpis .negative { background: #fef3f2; border-color: #fecdca; }

.portfolio-note {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475467;
}

.portfolio-table-wrap { margin-top: 18px; }
.portfolio-table { min-width: 900px; }
.portfolio-table th { background: #f8fafc; }
.portfolio-table td, .portfolio-table th { padding: 12px 10px; }
.portfolio-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.portfolio-table .money { text-align: right; font-variant-numeric: tabular-nums; }
.positive { color: #027a48; }
.negative { color: #b42318; }

.technical-details {
  margin-top: 16px;
  color: #667085;
  font-size: 13px;
}
.technical-details summary { cursor: pointer; font-weight: 600; color: #475467; }

.compact-price-panel { margin-top: 18px; }
.compact-notice { margin-bottom: 10px; }
.compact-summary { grid-template-columns: repeat(3, 1fr); }
.compact-summary .success-box { background: #ecfdf3; border-color: #abefc6; }
.compact-summary .warning-box { background: #fff7ed; border-color: #fed7aa; }

@media (max-width: 900px) {
  .portfolio-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .portfolio-kpis, .compact-summary { grid-template-columns: 1fr; }
}

.current-price { font-weight: 700; }
.manual-price-details { margin-top: 14px; }
.manual-price-details .price-grid { margin-top: 12px; }

.api-security-note {
  margin: 14px 0;
  padding: 13px 15px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.api-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 600;
}

.api-grid input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font: inherit;
}

.api-options {
  margin: 10px 0 16px;
  color: #475467;
}

.progress-panel {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #f8fafc;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: #172033;
  transition: width .15s ease;
}

.progress-detail {
  margin-top: 8px;
  color: #667085;
  font-size: 13px;
}

.portfolio-contribution {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #eaecf0;
}

.portfolio-contribution span {
  color: #667085;
  font-size: 13px;
}

.success-note {
  background: #ecfdf3;
  border-color: #a7f3d0;
}

@media (max-width: 700px) {
  .api-grid {
    grid-template-columns: 1fr;
  }
}

/* V0.5.11 — présentation portefeuille */
.portfolio-kpis .kpi-card {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e4e7ec;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .045);
}

.portfolio-kpis .kpi-card strong {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.portfolio-kpis .kpi-label {
  color: #475467;
  font-size: 13px;
  font-weight: 700;
  order: -1;
}

.portfolio-kpis .kpi-card small {
  color: #98a2b3;
  font-size: 12px;
}

.portfolio-kpis .kpi-card.positive {
  background: #f0fdf4;
  border-color: #a7f3d0;
}

.portfolio-kpis .kpi-card.negative {
  background: #fff7f7;
  border-color: #fecaca;
}

.modern-contribution {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.modern-contribution > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.contribution-label {
  color: #475467;
  font-weight: 700;
}

.modern-contribution > div strong {
  font-size: 20px;
}

.modern-contribution p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  text-align: right;
}

.portfolio-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
}

.portfolio-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: separate;
  border-spacing: 0;
}

.portfolio-table th {
  padding: 14px 12px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid #e4e7ec;
}

.portfolio-table th:first-child,
.portfolio-table td:first-child {
  text-align: left;
}

.portfolio-table td {
  padding: 15px 12px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
  white-space: nowrap;
}

.portfolio-table tbody tr:last-child td {
  border-bottom: 0;
}

.portfolio-table tbody tr:hover {
  background: #fafcff;
}

.portfolio-table .asset-cell {
  width: 72px;
}

.portfolio-table .number,
.portfolio-table .money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.portfolio-table .current-price {
  font-weight: 750;
  color: #172033;
}

.nowrap { white-space: nowrap !important; }

.technical-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.technical-grid > div {
  padding: 12px;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  background: #f9fafb;
}

.technical-grid strong,
.technical-grid span {
  display: block;
}

.technical-grid strong {
  font-size: 18px;
  color: #172033;
}

.technical-grid span {
  margin-top: 3px;
  font-size: 12px;
  color: #667085;
}

@media (max-width: 800px) {
  .modern-contribution {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .modern-contribution p {
    text-align: left;
  }

  .technical-grid {
    grid-template-columns: 1fr;
  }
}

.optional-label {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 400;
}
