/* Scope Versiune Nouă — Arbore WBS, Documente Proiect & Matrice Livrabile */

/* ======== Toolbar Arbore ======== */
.wbs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.wbs-toolbar-left, .wbs-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wbs-filter-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.08));
  background: transparent;
  color: var(--muted, #94a3b8);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wbs-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #f8fafc);
}
.wbs-filter-btn.active {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
  font-weight: 600;
}

/* ======== Tree Root & Container ======== */
.wbs-tree-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 8px;
}
.wbs-tree-container::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 20px;
  left: 20px;
  width: 2px;
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.4) 0%, rgba(56, 189, 248, 0.3) 50%, rgba(167, 139, 250, 0.2) 100%);
  border-radius: 2px;
}

/* ======== Tree Branch (Main Sections) ======== */
.wbs-branch {
  position: relative;
  padding-left: 36px;
}
.wbs-branch::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 12px;
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
}

.wbs-branch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.wbs-branch-header:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.wbs-branch-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.wbs-branch.docs .wbs-branch-icon {
  background: rgba(167, 139, 250, 0.15);
  color: #c084fc;
}
.wbs-branch.spec .wbs-branch-icon {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
}
.wbs-branch.tasks .wbs-branch-icon {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.wbs-branch-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text, #f8fafc);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wbs-branch-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #94a3b8);
}
.wbs-branch-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wbs-pct-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f8fafc);
}
.wbs-chevron {
  font-size: 14px;
  color: var(--muted, #94a3b8);
  transition: transform 0.2s ease;
  width: 20px;
  text-align: center;
}
.wbs-branch.collapsed .wbs-chevron {
  transform: rotate(-90deg);
}
.wbs-branch.collapsed .wbs-branch-content {
  display: none;
}

.wbs-branch-content {
  margin-top: 10px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.wbs-branch-content::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 16px;
  left: 6px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* ======== Sub-discipline Card (Sanitare, Electrice, etc.) ======== */
.wbs-subbranch {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.wbs-subbranch:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.wbs-subbranch-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line-2, rgba(255, 255, 255, 0.05));
  cursor: pointer;
}
.wbs-subbranch-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text, #f8fafc);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wbs-subbranch.collapsed .wbs-subbranch-body {
  display: none;
}
.wbs-subbranch.collapsed .wbs-sub-chev {
  transform: rotate(-90deg);
}

.wbs-subbranch-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ======== Phase Block (DTAC, PTh, As-built) ======== */
.wbs-phase-block {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 12px;
}
.wbs-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.wbs-phase-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  letter-spacing: 0.05em;
}
.wbs-phase-tag.pac, .wbs-phase-tag.dtac {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.wbs-phase-tag.pth {
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
}
.wbs-phase-tag.asbuilt {
  background: rgba(167, 139, 250, 0.15);
  color: #c084fc;
}
.wbs-phase-tag.generic {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.wbs-deliverables-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ======== Deliverable Row (Parte scrisă, Parte desenată, etc.) ======== */
.wbs-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: all 0.15s ease;
}
.wbs-item-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
.wbs-item-tree-glyph {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted, #64748b);
  user-select: none;
  flex-shrink: 0;
}
.wbs-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #f1f5f9);
  flex: 1;
  min-width: 140px;
}
.wbs-item-name.done {
  text-decoration: line-through;
  opacity: 0.6;
}

.wbs-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ======== Interactive Status Pills ======== */
.wbs-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}
.wbs-status-pill:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
}
.wbs-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Status variants */
.wbs-st-gata {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.wbs-st-lucru {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.35);
}
.wbs-st-verificare {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}
.wbs-st-asteptare {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.wbs-st-blocat {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
}
.wbs-st-neinceput {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.2);
}

/* Document specific statuses */
.wbs-doc-primit {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.wbs-doc-in_curs {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.wbs-doc-lipsa {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
}
.wbs-doc-revizuit {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

/* Assignee & Date Badges */
.wbs-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--muted, #94a3b8);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
}
.wbs-user-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text, #f8fafc);
}

.wbs-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted, #94a3b8);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}
.wbs-date-chip.overdue {
  background: rgba(244, 63, 94, 0.15);
  color: #f87171;
  font-weight: 600;
}
.wbs-date-chip.today {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  font-weight: 600;
}

/* Task Checkbox */
.wbs-task-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.wbs-task-check:hover {
  border-color: #2dd4bf;
}
.wbs-task-check.checked {
  background: #2dd4bf;
  border-color: #2dd4bf;
  color: #0d1520;
}

/* Priority Pills */
.wbs-prio-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wbs-prio-urgenta {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}
.wbs-prio-ridicata {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.wbs-prio-normala {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* ======== Documents Grid / Table View ======== */
.wbs-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.wbs-doc-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.06));
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}
.wbs-doc-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}
.wbs-doc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wbs-doc-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #f8fafc);
}
.wbs-doc-card-desc {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  line-height: 1.4;
}
.wbs-doc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ======== Matrix View (Matrice Livrabile) ======== */
.wbs-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}
.wbs-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.wbs-matrix-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #f8fafc);
  font-weight: 600;
  border-bottom: 1px solid var(--line-2, rgba(255, 255, 255, 0.08));
  border-right: 1px solid var(--line-2, rgba(255, 255, 255, 0.05));
  white-space: nowrap;
}
.wbs-matrix-table th:last-child {
  border-right: none;
}
.wbs-matrix-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.wbs-matrix-table td:last-child {
  border-right: none;
}
.wbs-matrix-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.wbs-matrix-cat-row td {
  background: rgba(45, 212, 191, 0.06);
  font-weight: 700;
  color: #2dd4bf;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 12px;
}

/* Quick Action Buttons */
.wbs-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wbs-add-btn:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: rgba(45, 212, 191, 0.45);
}

/* ======== Progress Widget în Antetul Proiectului ======== */
.proj-head-progress-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  max-width: 320px;
  flex: 1;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  backdrop-filter: blur(10px);
  margin: 0 8px;
}
.proj-head-progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.proj-head-progress-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #94a3b8);
}
.proj-head-progress-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #2dd4bf;
}
.proj-head-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.proj-head-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dd4bf 0%, #38bdf8 100%);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.proj-head-progress-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted, #94a3b8);
}
.proj-head-progress-sub b {
  color: var(--text, #f8fafc);
}

@media (max-width: 768px) {
  .proj-head-progress-box {
    min-width: 100%;
    max-width: 100%;
    margin: 8px 0 0 0;
  }
  .proj-head-mid > .proj-plan {
    margin-left: 0;
  }
}

/* ======== Phase Filter Tabs & Rail (DTAC, PTH, AS-BUILT, TOATE) ======== */
.proj-head-faze .wbs-phase-rail.stage-rail,
.wbs-phase-rail {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  /* padding interior: inelul activ + umbra nu mai sunt tăiate de overflow */
  padding: 4px 2px 2px;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.wbs-phase-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #94a3b8);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  flex: none;
}

.wbs-phase-tab:hover {
  filter: brightness(1.15);
}

.wbs-phase-tab.active {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 1px #2dd4bf, 0 2px 10px rgba(45, 212, 191, 0.22);
  font-weight: 700;
}

.wbs-phase-tab .stage-rail-mark {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wbs-phase-tab .stage-rail-lab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.wbs-phase-pill-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  margin-left: 3px;
  letter-spacing: 0.02em;
}

/* Stări de culoare identice cu pastilele de livrabil */
.wbs-phase-tab.wbs-st-gata {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}
.wbs-phase-tab.wbs-st-gata .wbs-phase-pill-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.wbs-phase-tab.wbs-st-lucru {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
.wbs-phase-tab.wbs-st-lucru .wbs-phase-pill-badge {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.wbs-phase-tab.wbs-st-neinceput {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}
.wbs-phase-tab.wbs-st-neinceput .wbs-phase-pill-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

.wbs-phase-tab.wbs-st-blocat {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fb7185;
}
.wbs-phase-tab.wbs-st-blocat .wbs-phase-pill-badge {
  background: rgba(244, 63, 94, 0.22);
  color: #fb7185;
}

/* Conectori între faze */
.wbs-phase-rail .stage-rail-edge {
  width: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  align-self: center;
  flex: none;
}
.wbs-phase-rail .stage-rail-edge.on {
  background: linear-gradient(90deg, #10b981 0%, #2dd4bf 100%);
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.4);
}

.wbs-phase-rail .wbs-add-phase-tab {
  flex: none;
  margin-left: 0;
  padding: 4px 12px;
  opacity: 0.9;
  font-size: 12px;
  font-weight: 600;
  border: 1px dashed rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.04);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  color: #2dd4bf;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wbs-phase-rail .wbs-add-phase-tab:hover {
  border-color: rgba(45, 212, 191, 0.7);
  background: rgba(45, 212, 191, 0.1);
}

/* WBS Delete Actions (Documents, Deliverables, Phases, Specialties) */
.wbs-btn-del {
  color: var(--muted, #94a3b8) !important;
  opacity: 0.6;
  font-size: 11px !important;
  transition: all 0.15s ease;
}
.wbs-item-row:hover .wbs-btn-del,
.wbs-phase-header:hover .wbs-btn-del,
.wbs-branch-header:hover .wbs-btn-del,
.wbs-doc-card:hover .wbs-btn-del {
  opacity: 1;
}
.wbs-btn-del:hover {
  color: #fb7185 !important;
  background: rgba(244, 63, 94, 0.14) !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
}

/* WBS Bulk Phase & Specialty Status Select */
.wbs-phase-status-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(15, 23, 42, 0.7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  height: 25px;
  line-height: 23px;
  padding: 0 22px 0 8px;
  cursor: pointer;
  max-width: 130px;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.wbs-phase-status-select:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background-color: rgba(30, 41, 59, 0.9);
  color: #f1f5f9;
}
.wbs-phase-status-select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  color: #ffffff;
}
.wbs-phase-status-select option {
  background-color: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  padding: 6px;
}

/* WBS Phase Header Buttons Compact Styling */
.wbs-phase-header .btn {
  height: 25px;
  line-height: 23px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text, #cbd5e1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: none;
  transform: none !important;
}
.wbs-phase-header .btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  box-shadow: none;
  transform: none !important;
}

/* WBS Add Deliverable Button (+) */
.wbs-btn-add-deliv {
  width: 25px !important;
  min-width: 25px !important;
  height: 25px !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: #2dd4bf !important;
  background: rgba(45, 212, 191, 0.1) !important;
  border: 1px solid rgba(45, 212, 191, 0.35) !important;
  border-radius: 6px !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}
.wbs-btn-add-deliv:hover {
  background: rgba(45, 212, 191, 0.25) !important;
  border-color: rgba(45, 212, 191, 0.8) !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.3) !important;
}

/* WBS Status Dropdown Popover */
.wbs-status-popover {
  position: absolute;
  z-index: 10050;
  min-width: 175px;
  background: rgba(13, 23, 39, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: popoverFadeIn 0.15s ease-out;
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.wbs-status-popover-header {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #94a3b8);
  padding: 2px 6px 6px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 2px;
}
.wbs-status-popover-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wbs-status-popover .wbs-pop-item {
  width: 100%;
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  cursor: pointer;
  padding: 5px 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  outline: none;
  transition: all 0.15s ease !important;
}
.wbs-status-popover .wbs-pop-item:hover {
  filter: brightness(1.25) !important;
  transform: translateX(3px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* WBS Bulk Trigger Button (Phase & Specialty) */
.wbs-bulk-trigger {
  min-width: 135px;
  height: 25px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 10px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
  user-select: none;
}
.wbs-bulk-trigger:hover {
  filter: brightness(1.18);
  transform: scale(1.02);
}
.wbs-deliv-trigger,
.wbs-doc-trigger {
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.wbs-deliv-trigger:hover,
.wbs-doc-trigger:hover {
  filter: brightness(1.18);
  transform: scale(1.02);
}
.wbs-trigger-caret {
  font-size: 10px;
  opacity: 0.7;
  margin-left: auto;
  transition: transform 0.15s ease;
}
.wbs-status-popover .wbs-pop-item.active-pop-item {
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
}

/* ========================================================
   Professional Tab Bar Enhancement & Contacte / Agendă
   ======================================================== */
.proj-tabs {
  display: flex !important;
  align-items: center;
  gap: 4px !important;
  padding: 6px 16px !important;
  background: rgba(13, 23, 39, 0.75) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  overflow-x: auto;
  scrollbar-width: thin;
}
.proj-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  padding: 7px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--muted, #94a3b8) !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  border-bottom: 1px solid transparent !important;
  margin-bottom: 0 !important;
}
.proj-tab:hover {
  color: var(--text, #f8fafc) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}
.proj-tab.on {
  color: #00ca9d !important;
  background: rgba(0, 202, 157, 0.12) !important;
  border-color: rgba(0, 202, 157, 0.25) !important;
  font-weight: 650 !important;
}
.proj-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #94a3b8);
  line-height: 1;
}
.proj-tab.on .proj-tab-badge {
  background: rgba(0, 202, 157, 0.25);
  color: #00ca9d;
}

/* Contacts Grid & Cards (project Contacte tab) */
.wbs-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  margin-top: 14px;
}
.agenda-head{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.agenda-head-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.agenda-body{
  padding: 14px 18px 20px;
}
.agenda-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.agenda-search-wrap{
  position: relative;
  flex: 1;
  min-width: min(100%, 240px);
  max-width: 320px;
}
.agenda-search-wrap .f-in{
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  padding: 0 10px 0 30px;
  font-size: 12.5px;
  border-radius: 8px;
}
.agenda-search-ico{
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.55;
  pointer-events: none;
}
.agenda-cat-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.agenda-cat-chip{
  cursor: pointer;
  font-size: 11px;
  padding: 3px 9px;
}

/* Agendă — listă pe rânduri (1 coloană) */
.agenda-list{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.agenda-row{
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  overflow: hidden;
  transition: background .14s ease, border-color .14s ease;
}
.agenda-row:hover,
.agenda-row.is-open{
  background: rgba(45,212,191,.05);
  border-color: rgba(45,212,191,.22);
}
.agenda-row-head{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
}
.agenda-row-toggle{
  display: grid;
  grid-template-columns: minmax(110px,1.2fr) minmax(90px,.9fr) minmax(90px,1fr) 16px;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
  width: 100%;
  padding: 8px 8px 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agenda-row-toggle:hover{ background: rgba(255,255,255,.03); }
.agenda-row-name{
  font-family: Outfit, sans-serif;
  font-size: .98rem;
  font-weight: 700;
  color: var(--ink, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-row-role,
.agenda-row-projs{
  font-size: 12px;
  color: var(--muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-row-acts{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding-right: 4px;
}
.agenda-act-call{
  text-decoration: none !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}
.agenda-act-wa{
  text-decoration: none !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  color: #34d399 !important;
  border-color: rgba(52,211,153,.28) !important;
}
.agenda-row-chev{
  font-size: 11px;
  color: var(--muted);
  justify-self: end;
  transition: transform .16s ease, color .14s ease;
}
.agenda-row.is-open .agenda-row-chev{
  transform: rotate(180deg);
  color: var(--accent, #2dd4bf);
}
.agenda-row-body{
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-top: 1px solid transparent;
  pointer-events: none;
  transition: max-height .2s ease, opacity .16s ease, border-color .16s ease;
}
.agenda-row.is-open .agenda-row-body{
  max-height: 420px;
  opacity: 1;
  border-top-color: rgba(148,163,184,.08);
  pointer-events: auto;
}
.agenda-row-body-inner{
  padding: 0 12px 12px;
}
.agenda-row-details{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 14px;
  padding-top: 10px;
}
@media (prefers-reduced-motion: reduce){
  .agenda-row-body,
  .agenda-row-chev{
    transition: none;
  }
}
.agenda-row-note{ grid-column: 1 / -1; }
.agenda-k{
  display: block;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.agenda-v{
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
}
.agenda-v.muted{ color: var(--muted); font-weight: 400; }
.agenda-mail-link{
  color: var(--accent, #2dd4bf);
  text-decoration: none;
}
.agenda-mail-link:hover{ text-decoration: underline; }
.agenda-row-linked{ margin-top: 10px; }
.agenda-proj-list{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.agenda-proj-link{
  border: 1px solid rgba(45,212,191,.22);
  background: rgba(45,212,191,.08);
  color: #5eead4;
  border-radius: 6px;
  padding: 4px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.agenda-proj-link:hover{ background: rgba(45,212,191,.16); }
.agenda-row-foot{
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
@media (max-width: 900px){
  .agenda-row-head{
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px 8px 8px;
  }
  .agenda-row-toggle{
    grid-template-columns: minmax(0,1fr) 16px;
    gap: 6px 8px;
  }
  .agenda-row-role,
  .agenda-row-projs{
    grid-column: 1 / -2;
  }
  .agenda-row-acts{
    padding-left: 10px;
  }
}
.ct-form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ct-save-agenda-opt{
  margin-top: 6px;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-2, #cbd5e1);
  cursor: pointer;
}
.ct-save-agenda-opt input{
  margin-top: 2px;
  flex: none;
}
.wbs-contact-card {
  background: rgba(18, 28, 48, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}
.wbs-contact-card:hover {
  border-color: rgba(0, 202, 157, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.wbs-contact-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wbs-contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.wbs-contact-info {
  flex: 1;
  min-width: 0;
}
.wbs-contact-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text, #f8fafc);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wbs-contact-role {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wbs-contact-firm {
  color: #cbd5e1;
}
.wbs-contact-cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.09);
  align-self: flex-start;
  white-space: nowrap;
}
.wbs-contact-comms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.wbs-call-btn {
  background: linear-gradient(135deg, #00ca9d 0%, #009e7a 100%) !important;
  color: #06151f !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 2px 10px rgba(0, 202, 157, 0.28);
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px;
}
.wbs-call-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
}
.wbs-wa-btn {
  color: #34d399 !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
  background: rgba(52, 211, 153, 0.06) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px;
}
.wbs-wa-btn:hover {
  background: rgba(52, 211, 153, 0.16) !important;
}
.wbs-mail-btn {
  color: #94a3b8 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px;
}
.wbs-mail-btn:hover {
  color: #f8fafc !important;
}
.wbs-contact-notes {
  font-size: 11.5px;
  color: var(--muted, #94a3b8);
  background: rgba(0, 0, 0, 0.22);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 2px solid #00ca9d;
  line-height: 1.45;
}
.wbs-contact-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--muted, #64748b);
}
.wbs-contact-projs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.wbs-contact-proj-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  background: rgba(0, 202, 157, 0.08);
  color: #00ca9d;
  border: 1px solid rgba(0, 202, 157, 0.18);
  cursor: pointer;
  text-decoration: none;
}
.wbs-contact-proj-tag:hover {
  background: rgba(0, 202, 157, 0.18);
}

/* Tabletă (iPad portrait / landscape îngust) */
@media (max-width: 1100px) {
  .proj-head{
    padding: 12px 14px 10px;
  }
  .proj-head-top h2{
    font-size: 1.35rem;
    min-width: 0;
  }
  .proj-head-progress-box{
    min-width: min(100%, 240px);
    max-width: 100%;
  }
  .proj-tabs{
    gap: 0;
    padding: 0 10px;
    -webkit-overflow-scrolling: touch;
  }
  .proj-tab{
    padding: 10px 12px;
    font-size: 13px;
  }
  .wbs-toolbar{
    padding: 10px 12px;
    gap: 10px;
  }
  .wbs-matrix-wrap{
    -webkit-overflow-scrolling: touch;
  }
  .wbs-matrix-table th:first-child,
  .wbs-matrix-table td:first-child{
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(11, 19, 36, 0.96);
    box-shadow: 4px 0 10px rgba(0,0,0,0.18);
  }
  .wbs-matrix-cat-row td:first-child{
    background: rgba(16, 40, 42, 0.98);
  }
  .wbs-matrix-table th,
  .wbs-matrix-table td{
    padding: 10px 12px;
  }
  .wbs-phase-rail{
    gap: 0;
    flex-wrap: nowrap;
  }
  .wbs-phase-tab{
    padding: 4px 10px;
  }
  .wbs-phase-pill-badge{
    display: none;
  }
  .wbs-item-row{
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .wbs-item-meta{
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .wbs-branch-header{
    flex-wrap: wrap;
    gap: 8px;
  }
  .wbs-branch-progress{
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .wbs-contacts-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agenda-body{
    padding: 14px 14px 28px;
  }
}

@media (max-width: 900px) and (min-width: 769px) {
  .wbs-contacts-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ct-form-grid{
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .wbs-tree-container{
    padding-left: 0;
  }
  .wbs-tree-container::before{
    display: none;
  }
  .wbs-branch{
    padding-left: 0;
  }
  .wbs-branch::before{
    display: none;
  }
  .wbs-item-tree-glyph{
    display: none;
  }
  .wbs-phase-header{
    flex-wrap: wrap;
    gap: 8px;
  }
  .wbs-matrix-table th,
  .wbs-matrix-table td{
    min-width: 110px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .wbs-matrix-table th:first-child,
  .wbs-matrix-table td:first-child{
    min-width: 140px;
  }
  .agenda-head{
    gap: 10px;
  }
  .agenda-head-actions{
    margin-left: 0;
    width: 100%;
  }
  .agenda-head-actions .btn{
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }
  .agenda-body{
    padding: 12px 10px 88px;
  }
  .agenda-toolbar{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .agenda-search-wrap{
    min-width: 0;
    max-width: none;
    width: 100%;
  }
  .agenda-cat-filters{
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .agenda-cat-filters::-webkit-scrollbar{ display: none; }
  .agenda-cat-chip{
    flex: none;
    white-space: nowrap;
  }
  .wbs-contacts-grid{
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }
  .wbs-contact-card{
    padding: 12px;
    gap: 10px;
  }
  .wbs-contact-card:hover{
    transform: none;
  }
  .wbs-contact-card-top{
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .wbs-contact-cat-badge{
    margin-left: auto;
  }
  .wbs-contact-comms{
    gap: 6px;
  }
  .wbs-contact-comms .btn,
  .wbs-contact-comms a.btn{
    min-height: 36px;
    flex: 1 1 auto;
    justify-content: center;
  }
  .wbs-contact-card-foot{
    flex-wrap: wrap;
    gap: 8px;
  }
  .wbs-contact-card-foot .btn{
    min-height: 34px;
  }
  .ct-form-grid{
    grid-template-columns: 1fr;
    gap: 0;
  }
  .ct-save-agenda-opt{
    width: 100%;
  }
}
