/* Proiecte, fișa proiectului, Documente. Classes are prefixed pr- to stay local. */

.pr-small { font-size: var(--text-sm); }
.pr-nowrap { white-space: nowrap; }
.pr-pills { gap: 6px; }
.pr-section-title { margin-bottom: 20px; }

.pr-person { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* Documents meter: bar + x/y */
.pr-meter { display: flex; align-items: center; gap: 10px; }
.pr-meter__bar { flex: 1; min-width: 64px; }
.pr-meter .num { font-size: var(--text-sm); font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ---------- Toolbar: filters + view toggle ---------- */
.pr-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.pr-seg {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.pr-seg button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px;
  background: none; color: var(--ink-2); font-size: var(--text-sm); font-weight: 750;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.pr-seg button:hover { color: var(--ink); }
.pr-seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pr-seg button[aria-pressed='true'] .icon { color: var(--primary); }

/* ---------- Table ---------- */
.pr-table { min-width: 860px; }
.pr-table--admin { min-width: 1040px; }
.pr-table td .score { vertical-align: middle; }

/* ---------- Board (kanban) ---------- */
.pr-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px;
  overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity;
  border-radius: var(--r-xl);
}
.pr-col {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 14px; border-radius: var(--r-xl); background: var(--surface-2);
  scroll-snap-align: start;
}
.pr-col__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 0; }
.pr-col__head .count { background: var(--surface); color: var(--ink-2); }
.pr-col__list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pr-col__empty {
  padding: 20px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  text-align: center; font-size: var(--text-sm); color: var(--muted);
}

.pr-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.pr-card:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pr-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pr-card__name { font-weight: 750; font-size: var(--text-base); line-height: 1.3; }
.pr-card__client { margin-top: -6px; font-size: var(--text-sm); color: var(--muted); }
.pr-card__docs { display: flex; flex-direction: column; gap: 6px; }
.pr-card__label { font-size: var(--text-xs); font-weight: 700; color: var(--muted); }
.pr-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.pr-card__date { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); }
.pr-card__date .icon { color: var(--muted); }
.pr-card__owner .avatar { width: 28px; height: 28px; font-size: 10px; }

/* ---------- Client: my project cards ---------- */
.pr-mine-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.pr-mine { display: flex; flex-direction: column; gap: 20px; }
.pr-mine__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pr-mine__title { margin-top: 6px; font-size: var(--text-2xl); }
.pr-mine__title a { color: var(--ink); }
.pr-mine__title a:hover { color: var(--primary); }
.pr-mine .facts dd .pr-meter { max-width: 200px; }

/* ---------- Project header and summary ---------- */
.pr-head .page-head__actions { align-items: center; }
.pr-head .crumbs { margin-bottom: 8px; }
.pr-head__pills { margin-top: 14px; }

.pr-stagepick { display: inline-flex; }
.pr-stagepick .select { width: auto; min-width: 160px; border-radius: var(--r-md) 0 0 var(--r-md); }
.pr-stagepick .btn { margin-left: -1px; border-radius: 0 var(--r-md) var(--r-md) 0; }
.pr-stagepick .select:focus { position: relative; z-index: 1; }

.pr-sum {
  display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr));
}
.pr-sum__cell { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px 24px; border-left: 1px solid var(--line); }
.pr-sum__cell:first-child { border-left: 0; }
.pr-sum__label { font-size: var(--text-xs); font-weight: 750; color: var(--muted); }
.pr-sum__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.pr-sum__value span { font-size: var(--text-lg); color: var(--muted); }
.pr-sum__value--text { font-size: var(--text-lg); letter-spacing: -0.01em; line-height: 1.25; }
.pr-sum__score { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: var(--text-sm); }
.pr-sum__person { white-space: normal; font-size: var(--text-md); }
.pr-sum__cell--track { justify-content: center; }

@media (max-width: 1100px) {
  .pr-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-sum__cell { border-left: 0; border-top: 1px solid var(--line); }
  .pr-sum__cell--track { grid-column: 1 / -1; border-top: 0; }
  .pr-sum__cell:nth-child(odd):not(.pr-sum__cell--track) { border-left: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .pr-sum { grid-template-columns: minmax(0, 1fr); }
  .pr-sum__cell { padding: 16px 20px; }
  .pr-sum__cell:nth-child(odd):not(.pr-sum__cell--track) { border-left: 0; }
}

/* ---------- Tabs + panel ---------- */
.pr-tabs { display: flex; flex-direction: column; gap: 24px; }
.pr-tabs .tab .count { margin-left: 2px; }
.pr-panel { display: flex; flex-direction: column; gap: 20px; border-radius: var(--r-md); }
.pr-panel:focus { box-shadow: none; }
.pr-panel:focus-visible { box-shadow: var(--ring); }
.pr-panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pr-panel-head p { margin-top: 4px; }

/* ---------- Etape ---------- */
.pr-stages { display: grid; gap: 20px; align-items: start; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); }
@media (max-width: 1080px) { .pr-stages { grid-template-columns: minmax(0, 1fr); } }

.pr-timeline { list-style: none; display: flex; flex-direction: column; }
.pr-tl { position: relative; display: flex; gap: 16px; padding-bottom: 24px; }
.pr-tl:last-child { padding-bottom: 0; }
.pr-tl::before {
  content: ''; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px;
  border-radius: 2px; background: var(--line);
}
.pr-tl:last-child::before { display: none; }
.pr-tl--done::before { background: var(--primary); }
.pr-tl__dot {
  position: relative; z-index: 1; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted);
  font-size: var(--text-sm); font-weight: 800; font-variant-numeric: tabular-nums;
}
.pr-tl__dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.pr-tl--done .pr-tl__dot { background: var(--primary); border-color: var(--primary); color: var(--surface); }
.pr-tl--now .pr-tl__dot { background: var(--dark); border-color: var(--dark); color: var(--accent); box-shadow: 0 0 0 4px var(--accent); }
.pr-tl__body { flex: 1; min-width: 0; padding-top: 6px; }
.pr-tl__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pr-tl__title { font-size: var(--text-lg); }
.pr-tl--next .pr-tl__title { color: var(--ink-2); }
.pr-tl__text { margin-top: 4px; font-size: var(--text-md); color: var(--muted); max-width: 520px; }
.pr-tl--now .pr-tl__body {
  margin-top: -6px; padding: 12px 16px; border-radius: var(--r-lg);
  background: var(--primary-soft);
}
.pr-tl--now .pr-tl__text { color: var(--ink-2); }

.pr-deadline { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; }
.pr-deadline .icon { color: var(--primary); }

.pr-check { list-style: none; padding: 8px 24px 16px; }
.pr-check__item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.pr-check__item:first-child { border-top: 0; }
.pr-check__mark {
  width: 26px; height: 26px; flex-shrink: 0; margin-top: 1px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
}
.pr-check__item.is-done .pr-check__mark { background: var(--success-soft); color: var(--success); }
.pr-check__item.is-done .pr-check__mark .icon { stroke-width: 3; }
.pr-check__body { flex: 1; min-width: 0; }
.pr-check__title { font-weight: 750; font-size: var(--text-md); }
.pr-check__sub { margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }

/* Client: what comes next */
.pr-next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-radius: var(--r-xl);
  background: var(--dark); color: var(--surface);
}
.pr-next__title { font-size: var(--text-lg); color: var(--accent); }
.pr-next__text { margin-top: 6px; max-width: 620px; font-size: var(--text-md); color: var(--mint); }
.pr-next__text strong { color: var(--surface); }
.pr-next .btn--primary { background: var(--accent); color: var(--on-accent); }
.pr-next .btn--primary:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
@media (max-width: 640px) { .pr-next .btn { width: 100%; } }

/* ---------- Document items ---------- */
.pr-docs { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.pr-doc {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.pr-doc--rejected { border-color: var(--danger-soft); box-shadow: inset 3px 0 0 var(--danger); }
.pr-doc__main { display: flex; align-items: flex-start; gap: 14px; }
.pr-doc__icon {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-ink);
}
.pr-doc__body { flex: 1; min-width: 0; }
.pr-doc__title { font-family: var(--font-ui); font-size: var(--text-base); font-weight: 750; letter-spacing: 0; }
.pr-doc__meta { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: var(--text-sm); color: var(--muted); }
.pr-doc__meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.pr-doc__cat { font-weight: 750; color: var(--ink-2); }
.pr-doc__file { overflow-wrap: anywhere; color: var(--ink-2); font-weight: 600; }
.pr-doc__status { flex-shrink: 0; }
.pr-doc__note { background: var(--danger-soft); color: var(--ink-2); }
.pr-doc__note > .icon { color: var(--danger); }
.pr-doc__actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.pr-doc__review, .pr-doc__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-doc__tools { margin-left: auto; }
@media (max-width: 560px) {
  .pr-doc { padding: 16px; }
  .pr-doc__main { flex-wrap: wrap; }
  .pr-doc__status { order: -1; width: 100%; padding-left: 58px; margin-bottom: -6px; }
  .pr-doc__icon { width: 40px; height: 40px; }
  .pr-doc__tools { margin-left: 0; }
  .pr-doc__review { width: 100%; }
}

/* Version history (dialog) */
.pr-versions { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pr-versions__item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--paper); }
.pr-versions__item:first-child { background: var(--primary-soft); }
.pr-versions__v {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 10px; background: var(--surface); font-weight: 800; font-size: var(--text-sm); color: var(--ink-2);
}
.pr-versions__body { flex: 1; min-width: 0; }
.pr-versions__file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 750; font-size: var(--text-md); overflow-wrap: anywhere; }
.pr-versions__meta { margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }

/* Locked field in the upload dialog */
.pr-locked { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.pr-locked__label { font-size: var(--text-xs); font-weight: 750; color: var(--muted); }
.pr-locked__value { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; }
.pr-locked__value .icon { color: var(--muted); }

/* ---------- Documente page ---------- */
.pr-review {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--warn-soft); color: var(--ink-2); font-size: var(--text-md);
}
.pr-review > .icon { color: var(--warn); }
.pr-review p { flex: 1; min-width: 200px; }
.pr-review strong { color: var(--ink); }

.pr-group { display: flex; flex-direction: column; gap: 12px; }
.pr-group__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; padding: 0 4px; }
.pr-group__title { font-size: var(--text-xl); }
.pr-group__title a { color: var(--ink); }
.pr-group__title a:hover { color: var(--primary); }
.pr-group__head p { margin-top: 2px; }

/* ---------- Diagnostic tab ---------- */
.pr-diag__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; padding: 24px; }
.pr-diag__summary { flex: 1; min-width: min(100%, 280px); display: flex; flex-direction: column; gap: 12px; }
.pr-diag__rec { max-width: 680px; color: var(--ink-2); }
.pr-diag__cols {
  display: grid; gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.pr-diag__col { padding: 20px 24px; border-left: 1px solid var(--line); min-width: 0; }
.pr-diag__col:first-child { border-left: 0; }
.pr-diag__h { font-family: var(--font-ui); font-size: var(--text-sm); font-weight: 800; letter-spacing: 0; margin-bottom: 12px; }
.pr-diag__list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: var(--text-md); color: var(--ink-2); }
.pr-diag__list li { display: flex; gap: 10px; align-items: flex-start; }
.pr-diag__ic { margin-top: 2px; flex-shrink: 0; }
.pr-diag__ic--success { color: var(--success); }
.pr-diag__ic--warn { color: var(--warn); }
.pr-diag__ic--info { color: var(--info); }
.pr-diag__foot { padding: 16px 24px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .pr-diag__cols { grid-template-columns: minmax(0, 1fr); }
  .pr-diag__col { border-left: 0; border-top: 1px solid var(--line); }
  .pr-diag__col:first-child { border-top: 0; }
}

@media (max-width: 640px) {
  .pr-head .page-head__actions { width: 100%; }
  .pr-stagepick { flex: 1; }
  .pr-stagepick .select { flex: 1; min-width: 0; }
  .pr-toolbar .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; width: calc(100% + 32px); }
  .pr-toolbar .filter { flex-shrink: 0; }
  .pr-board { grid-auto-columns: minmax(260px, 82%); }
}
