/* Proiecte Fonduri UE — secțiunea din pagina firmei (app/static/js/fonduri.js).
   Folosește tokenii portalului din style.css; adaugă doar albastrul UE și griul pentru neeligibil. */
.fonduri { --fd-eu: #7c93f5; --fd-neelig: #454b5e; display: grid; gap: 18px; }
html[data-theme="light"] .fonduri { --fd-eu: #3b5bdb; --fd-neelig: #b7bfcc; }
@media (prefers-color-scheme: light) {
  html[data-theme="system"] .fonduri { --fd-eu: #3b5bdb; --fd-neelig: #b7bfcc; }
}

.fonduri h4 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-dim); }
.fd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fd-stats > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 3px; align-content: start; font-variant-numeric: tabular-nums; }
.fd-stats b { font-size: 20px; font-weight: 800; color: var(--text); }
.fd-stats small { font-size: 12px; color: var(--text-muted); }
.fd-l { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-dim); }

.fd-meter { display: block; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 4px; max-width: 140px; }
.fd-meter i { display: block; height: 100%; background: var(--success); border-radius: 99px; }

.fd-struct, .fd-full { display: grid; gap: 8px; }
.fd-bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--border); }
.fd-bar span { display: block; height: 100%; }
.fd-seg-eu { background: var(--fd-eu); }
.fd-seg-stat { background: var(--accent); }
.fd-seg-prop { background: var(--warning); }
.fd-seg-ne { background: var(--fd-neelig); }
.fd-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fd-legend li { display: flex; align-items: center; gap: 6px; }
.fd-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fd-legend b { color: var(--text); }

.fd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.fd-head .fd-count { margin-right: auto; }
.fd-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.fd-seg button { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 0; padding: 6px 11px; cursor: pointer; }
.fd-seg button + button { border-left: 1px solid var(--border); }
.fd-seg button[aria-pressed="true"] { background: var(--accent-dim); color: var(--accent); }

.fd-scroll { overflow-x: auto; }
.fd-tbl { min-width: 960px; font-variant-numeric: tabular-nums; }
.fd-tbl th { white-space: nowrap; }
.fd-tbl td { vertical-align: top; }
.fd-r { text-align: right !important; }
.fd-nowrap { white-space: nowrap; }
.fd-row { cursor: pointer; }
.fd-row.fd-open td, .fd-detail td { background: var(--surface-2); }
.fd-ttl { font-weight: 600; min-width: 30ch; max-width: 48ch; }
.fd-ttl span, .fd-sub { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.fd-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.fd-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fd-run { background: var(--accent-dim); color: var(--accent); }
.fd-done { background: var(--success-dim); color: var(--success); }
.fd-tl { position: relative; display: block; width: 160px; height: 8px; border-radius: 99px; background: var(--border); margin-top: 6px; }
.fd-tl-b { position: absolute; top: 0; height: 100%; border-radius: 99px; background: var(--accent); }
.fd-tl-done .fd-tl-b { background: var(--success); }
.fd-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--warning); }
.fd-toggle { font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.fd-toggle:focus-visible, .fd-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fd-det { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px 26px; padding: 4px 4px 12px; }
.fd-det h4 { margin-bottom: 6px; }
.fd-scop { margin: 0; max-width: 68ch; line-height: 1.55; white-space: normal; }
.fd-note { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); }
.fd-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; font-size: 13px; }
.fd-kv dt { color: var(--text-dim); }
.fd-kv dd { margin: 0; white-space: normal; overflow-wrap: anywhere; }   /* coduri de apel lungi, fără spații */
.fd-full { grid-column: 1 / -1; }
.fd-foot { margin: 0; font-size: 12.5px; color: var(--text-dim); }

@media (max-width: 860px) {
  .fd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-det { grid-template-columns: minmax(0, 1fr); }
}
/* telefon: tabelul de 960px devine carduri, ca detaliile (scop, apel) să nu iasă din ecran */
@media (max-width: 760px) {
  .fd-scroll { overflow-x: visible; }
  .fd-tbl { min-width: 0; }
  .fd-tbl thead { display: none; }
  .fd-tbl, .fd-tbl tbody, .fd-tbl tr, .fd-tbl td { display: block; }
  .fd-tbl tr.fd-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .fd-tbl tr.fd-row td { border: 0; padding: 0; }
  .fd-tbl tr.fd-row td:first-child, .fd-tbl td.fd-per { grid-column: 1 / -1; }
  .fd-tbl td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-dim); }
  .fd-r { text-align: left !important; }
  .fd-nowrap { white-space: normal; }
  .fd-ttl { min-width: 0; max-width: none; }
  .fd-tl { width: 100%; }
  .fd-tbl tr.fd-detail td { padding: 4px 4px 18px; border-bottom: 1px solid var(--border); }
}
@media (max-width: 440px) {
  .fd-stats { grid-template-columns: minmax(0, 1fr); }
}
