/* ==========================================================================
   TRINO — Fundos & Lâminas
   ========================================================================== */

#fundos-root {
  color: #f4f1eb;
  background:
    radial-gradient(circle at 12% -10%, rgba(199, 161, 87, .08), transparent 32rem),
    #0b0f12;
}

.fund-page {
  width: min(1420px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.fund-page-header,
.fund-toolbar,
.fund-admin-card > header,
.fund-record-title,
.operation-fund-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.fund-page-header h2 {
  margin: 7px 0 6px;
  color: #fbfaf7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: -.025em;
}

.fund-page-header p {
  max-width: 750px;
  margin: 0;
  color: #a7adb1;
  font-size: 13px;
  line-height: 1.65;
}

.fund-kicker {
  color: #d9b668;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.fund-header-actions,
.fund-record-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fund-page .btn {
  min-height: 36px;
  border: 1px solid #30363a;
  border-radius: 8px;
  background: #111619;
  color: #e9e6df;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.fund-page .btn:hover,
.fund-link:hover {
  border-color: #6f603e;
  color: #f3ce7a;
}

.fund-page .btn.primary {
  border-color: #d0ad62;
  background: #d0ad62;
  color: #15120d;
}

.fund-coverage {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 28px 0 14px;
  overflow: hidden;
  border: 1px solid #2a3033;
  border-radius: 12px;
  background: #101518;
}

.fund-metric {
  min-width: 0;
  padding: 17px 20px;
  border-right: 1px solid #2a3033;
}

.fund-metric:last-child { border-right: 0; }

.fund-metric span,
.operation-fund-metrics span {
  display: block;
  color: #858e93;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.fund-metric strong {
  display: block;
  margin-top: 7px;
  color: #f3f0ea;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.fund-metric small {
  display: block;
  margin-top: 4px;
  color: #7d8589;
  font-size: 9px;
}

.fund-metric.positive strong { color: #76d7ae; }
.fund-metric.negative strong { color: #ef9d9d; }
.fund-metric.warning strong { color: #e0bd70; }

.fund-rule-banner {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(208, 173, 98, .3);
  border-radius: 10px;
  background: rgba(208, 173, 98, .065);
}

.fund-rule-banner strong {
  color: #f0d596;
  font-size: 11px;
}

.fund-rule-banner p {
  margin: 0;
  color: #aeb0ac;
  font-size: 11px;
  line-height: 1.5;
}

.fund-link {
  color: #cdbb91;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.fund-toolbar {
  margin: 18px 0 10px;
  padding: 12px;
  border: 1px solid #292f32;
  border-radius: 10px;
  background: #0f1417;
}

.fund-toolbar > input {
  flex: 1;
  min-width: 230px;
  height: 38px;
  border: 1px solid #30373b;
  border-radius: 7px;
  background: #0b1013;
  color: #f1eee8;
  padding: 0 13px;
  font-size: 12px;
}

.fund-toolbar > input:focus,
.fund-form-field input:focus,
.fund-form-field select:focus,
.fund-form-field textarea:focus {
  outline: 2px solid rgba(208, 173, 98, .42);
  outline-offset: 1px;
  border-color: #8e7441;
}

.fund-cdi-status {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 9px;
  min-width: 155px;
}

.fund-cdi-status span,
.fund-cdi-status small {
  color: #80898d;
  font-size: 9px;
}

.fund-cdi-status strong {
  color: #f2cf7d;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.fund-cdi-status small { grid-column: 1 / -1; }

.fund-list {
  display: grid;
  gap: 10px;
}

.fund-admin-card {
  overflow: hidden;
  border: 1px solid #282f32;
  border-radius: 11px;
  background: linear-gradient(180deg, #111619, #0f1417);
}

.fund-admin-card > header {
  padding: 13px 15px;
  border-bottom: 1px solid #272d30;
}

.fund-admin-card > header > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.fund-admin-card h3 {
  margin: 0;
  color: #f5f2ec;
  font-size: 13px;
  letter-spacing: .035em;
}

.fund-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .025);
}

.fund-status-dot.confirmed { background: #6dd5a8; }
.fund-status-dot.partial { background: #d9b65f; }
.fund-status-dot.pending { background: #697277; }

.fund-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #3a4144;
  border-radius: 999px;
  padding: 0 8px;
  color: #9ca4a7;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fund-status.confirmed {
  border-color: rgba(109, 213, 168, .35);
  color: #79dcb2;
  background: rgba(109, 213, 168, .06);
}

.fund-status.partial {
  border-color: rgba(217, 182, 95, .4);
  color: #e1c173;
  background: rgba(217, 182, 95, .06);
}

.fund-record-body,
.fund-record-pending {
  padding: 16px;
}

.fund-record-title > div {
  display: grid;
  gap: 4px;
}

.fund-record-title strong {
  color: #f6f3ec;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
}

.fund-record-title span:not(.fund-status),
.fund-record-pending p {
  margin: 0;
  color: #a3aaad;
  font-size: 11px;
  line-height: 1.45;
}

.fund-record-pending small {
  color: #747d81;
  font-size: 9px;
}

.fund-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 15px 0;
  overflow: hidden;
  border: 1px solid #303639;
  border-radius: 8px;
}

.fund-metrics .fund-metric { padding: 13px 14px; }
.fund-metrics .fund-metric strong { font-size: 14px; }

.fund-strategy {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding: 12px 13px;
  border-left: 2px solid #d2ad5c;
  background: rgba(210, 173, 92, .06);
}

.fund-strategy span {
  color: #8e9496;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.fund-strategy strong {
  color: #d8d5cf;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.55;
}

.fund-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 10px;
  color: #737c80;
  font-size: 9px;
}

.fund-other-records {
  border-top: 1px solid #272d30;
  padding: 10px 15px;
  color: #9ba2a5;
  font-size: 10px;
}

.fund-other-records summary { cursor: pointer; }
.fund-other-records > div { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.fund-other-records button {
  border: 1px solid #343b3e;
  border-radius: 6px;
  background: #0c1114;
  color: #bdc2c4;
  padding: 7px 9px;
  font-size: 9px;
  cursor: pointer;
}

.fund-empty {
  padding: 40px;
  border: 1px dashed #343a3d;
  border-radius: 10px;
  color: #8d969a;
  text-align: center;
  font-size: 12px;
}

.fund-page-footer {
  margin-top: 16px;
  color: #666f73;
  font-size: 9px;
  line-height: 1.5;
}

/* Editor documental */
.fund-editor-overlay {
  z-index: 10030;
  align-items: flex-start;
  overflow-y: auto;
  padding: 28px 14px;
  background: rgba(3, 6, 8, .78);
  backdrop-filter: blur(8px);
}

.fund-editor {
  width: min(920px, calc(100vw - 28px));
  margin: auto;
  border: 1px solid #373b3c;
  border-radius: 13px;
  background: #111619;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
  color: #f3f0e9;
}

.fund-editor > header,
.fund-editor > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.fund-editor > header { border-bottom: 1px solid #292f31; }
.fund-editor > footer {
  justify-content: flex-end;
  border-top: 1px solid #292f31;
}
.fund-editor > footer .danger { margin-right: auto; color: #efa4a4; }

.fund-editor h2 {
  margin: 4px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.fund-editor header p {
  margin: 0;
  color: #8f979a;
  font-size: 10px;
}

.fund-editor-close {
  width: 34px;
  height: 34px;
  border: 1px solid #393f42;
  border-radius: 8px;
  background: transparent;
  color: #d9dcdd;
  font-size: 20px;
  cursor: pointer;
}

.fund-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
  padding: 18px 20px;
}

.fund-form-field {
  display: grid;
  align-content: start;
  gap: 6px;
  color: #bcc1c2;
  font-size: 10px;
}

.fund-form-field input,
.fund-form-field select,
.fund-form-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 39px;
  border: 1px solid #343b3e;
  border-radius: 7px;
  background: #0c1114;
  color: #f1eee7;
  padding: 9px 11px;
  font: inherit;
  font-size: 11px;
}

.fund-form-field textarea { resize: vertical; min-height: 74px; }
.fund-form-field small { color: #6f777a; font-size: 8px; line-height: 1.4; }

.fund-quota-section {
  margin: 0 20px 18px;
  border: 1px solid #2d3437;
  border-radius: 9px;
  background: #0d1215;
}

.fund-quota-section > div:first-child {
  display: grid;
  gap: 3px;
  padding: 13px 16px 0;
}

.fund-quota-section strong { font-size: 11px; }
.fund-quota-section span { color: #7f888c; font-size: 9px; }
.fund-form-grid.quota { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 12px; }
.fund-form-status { min-height: 20px; padding: 0 20px 8px; color: #efa1a1; font-size: 10px; }

/* Resumo dentro da operação */
.operation-fund-summary {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(208, 173, 98, .28);
  border-radius: 9px;
  background: rgba(208, 173, 98, .045);
}

.operation-fund-head { padding: 12px 13px; }
.operation-fund-head > div { display: grid; gap: 3px; }
.operation-fund-head span {
  color: #b79857;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .11em;
}
.operation-fund-head strong { color: #e9e5dc; font-size: 11px; }
.operation-fund-head button {
  border: 0;
  background: transparent;
  color: #d9bc78;
  font-size: 9px;
  cursor: pointer;
}

.operation-fund-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(208, 173, 98, .16);
  border-bottom: 1px solid rgba(208, 173, 98, .16);
}

.operation-fund-metrics > div {
  padding: 10px 13px;
  border-right: 1px solid rgba(208, 173, 98, .16);
}
.operation-fund-metrics > div:last-child { border-right: 0; }
.operation-fund-metrics strong {
  display: block;
  margin-top: 4px;
  color: #e8e3da;
  font-size: 10px;
}
.operation-fund-summary > p {
  margin: 0;
  padding: 10px 13px;
  color: #92999b;
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .fund-page { width: min(100% - 24px, 1420px); padding-top: 22px; }
  .fund-page-header { align-items: flex-start; }
  .fund-coverage, .fund-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-coverage .fund-metric:nth-child(2),
  .fund-metrics .fund-metric:nth-child(2) { border-right: 0; }
  .fund-rule-banner { grid-template-columns: 1fr; gap: 7px; }
  .fund-form-grid.quota { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .fund-page-header, .fund-toolbar, .fund-admin-card > header, .fund-record-title {
    align-items: stretch;
    flex-direction: column;
  }
  .fund-header-actions { width: 100%; }
  .fund-header-actions .btn { flex: 1; justify-content: center; }
  .fund-coverage, .fund-metrics, .fund-form-grid, .fund-form-grid.quota { grid-template-columns: 1fr; }
  .fund-metric { border-right: 0; border-bottom: 1px solid #2a3033; }
  .fund-metric:last-child { border-bottom: 0; }
  .fund-toolbar > input { width: 100%; min-width: 0; }
}
