/* =============================================================================
   Setup Page Redesign — Maestro
   Reference: maestro-setup-redesign.html
   ============================================================================= */

:root {
  --setup-bg: #f0f4f8;
  --setup-surface: #ffffff;
  --setup-surface2: #f8fafc;
  --setup-border: #e2e8f0;
  --setup-border-strong: #cbd5e1;
  --setup-blue-muted: #dbeafe;
  --setup-text: #0f172a;
  --setup-text-2: #475569;
  --setup-text-3: #94a3b8;
  --setup-navy: #0d1b2a;
  --setup-blue: #2563eb;
  --setup-blue-light: #3b82f6;
  --setup-green: #10b981;
  --setup-green-bg: #d1fae5;
  --setup-red: #ef4444;
  --setup-red-bg: #fee2e2;
  --setup-amber: #f59e0b;
  --setup-amber-bg: #fef3c7;
  --setup-radius: 12px;
  --setup-radius-sm: 8px;
  --setup-sidebar-w: 260px;
}

/* Body / layout when setup redesign is active */
body.setup-redesign {
  font-family: 'DM Sans', sans-serif;
  background: var(--setup-bg);
  color: var(--setup-text);
}
body.setup-redesign .setup-layout {
  margin-top: 0;
  align-items: stretch;
  min-height: calc(100vh - 80px);
}

/* ── SIDEBAR ── */
body.setup-redesign .setup-sidebar {
  width: var(--setup-sidebar-w);
  min-width: var(--setup-sidebar-w);
  background: var(--setup-surface);
  border-right: 1px solid var(--setup-border);
  border-radius: 0;
  padding: 20px 12px 24px;
  margin-right: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
}
body.setup-redesign .setup-sidebar::-webkit-scrollbar {
  width: 4px;
}
body.setup-redesign .setup-sidebar::-webkit-scrollbar-thumb {
  background: var(--setup-border-strong);
  border-radius: 4px;
}

body.setup-redesign .sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--setup-text-3);
  font-family: 'Outfit', sans-serif;
  padding: 6px 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.setup-redesign .sidebar-group-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--setup-text-3);
}

body.setup-redesign .setup-sidebar .tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--setup-radius-sm);
  border-left: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--setup-text-2);
  text-align: left;
  width: 100%;
  background: transparent;
  position: relative;
  transition: all 0.15s ease;
}
body.setup-redesign .setup-sidebar .tab-btn:hover {
  background: var(--setup-bg);
  color: var(--setup-text);
}
body.setup-redesign .setup-sidebar .tab-btn.active {
  background: var(--setup-blue-muted);
  color: var(--setup-blue);
  font-weight: 500;
}
body.setup-redesign .setup-sidebar .tab-btn .item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--setup-text-3);
  flex-shrink: 0;
  transition: 0.15s;
}
body.setup-redesign .setup-sidebar .tab-btn:hover .item-icon,
body.setup-redesign .setup-sidebar .tab-btn.active .item-icon {
  color: var(--setup-blue);
}
body.setup-redesign .setup-sidebar .tab-btn .item-label {
  flex: 1;
  line-height: 1.2;
  min-width: 0;
}
body.setup-redesign .setup-sidebar .tab-btn .item-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--setup-text-3);
  background: var(--setup-bg);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
body.setup-redesign .setup-sidebar .tab-btn.active .item-count {
  background: rgba(37, 99, 235, 0.15);
  color: var(--setup-blue);
}

body.setup-redesign .sidebar-divider {
  height: 1px;
  background: var(--setup-border);
  margin: 8px 4px;
}

/* ── MAIN CONTENT ── */
body.setup-redesign .setup-main {
  flex: 1;
  padding: 32px 36px;
  max-width: 1100px;
  min-width: 0;
  overflow-y: auto;
}
body.setup-redesign .setup-main::-webkit-scrollbar {
  width: 6px;
}
body.setup-redesign .setup-main::-webkit-scrollbar-thumb {
  background: var(--setup-border-strong);
  border-radius: 6px;
}

/* ── PAGE HEADER ── */
body.setup-redesign .page-header-setup {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
body.setup-redesign .page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
body.setup-redesign .page-icon-setup {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e3a5f, var(--setup-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}
body.setup-redesign .page-title-group-setup h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--setup-text);
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 0;
}
body.setup-redesign .page-title-group-setup p {
  font-size: 13px;
  color: var(--setup-text-2);
  margin-top: 2px;
  margin-bottom: 0;
}

/* Primary button in header */
body.setup-redesign .page-header-setup .btn-primary,
body.setup-redesign .page-header-setup .btn.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--setup-navy);
  color: white;
  border: none;
  border-radius: var(--setup-radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}
body.setup-redesign .page-header-setup .btn-primary:hover,
body.setup-redesign .page-header-setup .btn.btn-primary:hover {
  background: #1a2d42;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── METHODOLOGY CARDS ── */
body.setup-redesign .methodology-group {
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease;
}
body.setup-redesign .methodology-group:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

body.setup-redesign .method-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: 0.15s ease;
}
body.setup-redesign .method-group-header.open {
  border-bottom-color: var(--setup-border);
}
body.setup-redesign .method-group-header:hover {
  background: var(--setup-surface2);
}

body.setup-redesign .method-group-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.setup-redesign .method-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--setup-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--setup-green-bg);
}
body.setup-redesign .method-badge.inactive {
  background: var(--setup-text-3);
  box-shadow: 0 0 0 3px var(--setup-bg);
}
body.setup-redesign .method-group-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--setup-text);
}
body.setup-redesign .status-chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
}
body.setup-redesign .status-chip.ativa {
  background: var(--setup-green-bg);
  color: #065f46;
}
body.setup-redesign .status-chip.inativa {
  background: var(--setup-bg);
  color: var(--setup-text-3);
}

body.setup-redesign .method-group-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.setup-redesign .phase-count {
  font-size: 12px;
  color: var(--setup-text-3);
  font-weight: 500;
}
body.setup-redesign .chevron-setup {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--setup-text-3);
  transition: transform 0.2s ease;
  font-size: 14px;
}
body.setup-redesign .chevron-setup.open {
  transform: rotate(180deg);
}

/* Phase list */
body.setup-redesign .phase-list {
  padding: 8px 0;
}
body.setup-redesign .phase-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  transition: background 0.12s ease;
  position: relative;
}
body.setup-redesign .phase-item:hover {
  background: var(--setup-surface2);
}
body.setup-redesign .phase-item:hover .phase-actions {
  opacity: 1;
}

body.setup-redesign .phase-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--setup-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
body.setup-redesign .phase-num.phase-num-dmaci {
  background: #059669;
}
body.setup-redesign .phase-info {
  flex: 1;
  min-width: 0;
}
body.setup-redesign .phase-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--setup-text);
}
body.setup-redesign .phase-desc {
  font-size: 12px;
  color: var(--setup-text-3);
  margin-top: 1px;
}

body.setup-redesign .phase-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
body.setup-redesign .action-btn-setup {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--setup-border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--setup-text-3);
  font-size: 13px;
  transition: all 0.12s ease;
}
body.setup-redesign .action-btn-setup:hover.edit {
  border-color: var(--setup-blue);
  color: var(--setup-blue);
  background: var(--setup-blue-muted);
}
body.setup-redesign .action-btn-setup:hover.delete {
  border-color: var(--setup-red);
  color: var(--setup-red);
  background: var(--setup-red-bg);
}

body.setup-redesign .phase-connector {
  position: absolute;
  left: 29px;
  top: 38px;
  bottom: 0;
  width: 1px;
  background: var(--setup-border);
}
body.setup-redesign .phase-item:last-child .phase-connector {
  display: none;
}

/* Add phase inline */
body.setup-redesign .add-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 14px;
}
body.setup-redesign .add-phase-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px dashed var(--setup-border-strong);
  background: transparent;
  color: var(--setup-text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'DM Sans', sans-serif;
}
body.setup-redesign .add-phase-btn:hover {
  border-color: var(--setup-blue);
  color: var(--setup-blue);
  background: var(--setup-blue-muted);
}

/* Methodology group actions (edit/delete method) */
body.setup-redesign .method-group-actions {
  display: flex;
  gap: 8px;
  padding: 8px 18px 14px;
  border-top: 1px solid var(--setup-border);
  background: var(--setup-surface2);
}
body.setup-redesign .method-group-actions .btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s ease;
}

/* ── P&L SECTIONS ── */
body.setup-redesign .info-banner-setup {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--setup-radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #1e40af;
}
body.setup-redesign .info-banner-setup .icon {
  font-size: 16px;
  flex-shrink: 0;
}

body.setup-redesign .pl-section {
  margin-bottom: 16px;
}
body.setup-redesign .pl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius) var(--setup-radius) 0 0;
  cursor: pointer;
  transition: 0.15s ease;
}
body.setup-redesign .pl-section-header.collapsed {
  border-radius: var(--setup-radius);
}
body.setup-redesign .pl-section-header.collapsed + .pl-items {
  display: none;
}
body.setup-redesign .pl-section-name {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
body.setup-redesign .pl-section-name.revenue {
  color: #059669;
}
body.setup-redesign .pl-section-name.cogs {
  color: #b45309;
}
body.setup-redesign .pl-section-name.expenses {
  color: #dc2626;
}

body.setup-redesign .pl-items {
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-top: none;
  border-radius: 0 0 var(--setup-radius) var(--setup-radius);
  overflow: hidden;
}
body.setup-redesign .pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--setup-border);
  transition: background 0.12s ease;
}
body.setup-redesign .pl-item:last-child {
  border-bottom: none;
}
body.setup-redesign .pl-item:hover {
  background: var(--setup-surface2);
}
body.setup-redesign .pl-item:hover .phase-actions {
  opacity: 1;
}
body.setup-redesign .pl-order {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--setup-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: 'Outfit', sans-serif;
}
body.setup-redesign .pl-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--setup-text);
  flex: 1;
}
body.setup-redesign .pl-item-desc {
  font-size: 12px;
  color: var(--setup-text-3);
}
body.setup-redesign .pl-add-row {
  padding: 10px 18px;
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-top: none;
  border-radius: 0 0 var(--setup-radius) var(--setup-radius);
}

/* ── KPI GRID ── */
body.setup-redesign .kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
body.setup-redesign .kpi-card {
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius);
  padding: 16px;
  transition: all 0.15s ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}
body.setup-redesign .kpi-card.enabled {
  border-color: var(--setup-blue-light);
  box-shadow: 0 0 0 1px var(--setup-blue-light);
}
body.setup-redesign .kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--setup-border);
  transition: 0.2s ease;
}
body.setup-redesign .kpi-card.enabled::before {
  background: linear-gradient(90deg, var(--setup-blue), #0ea5e9);
}
body.setup-redesign .kpi-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
body.setup-redesign .kpi-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--setup-text);
  font-family: 'Outfit', sans-serif;
}
body.setup-redesign .kpi-card-desc {
  font-size: 11px;
  color: var(--setup-text-3);
  margin-top: 4px;
  line-height: 1.4;
}
body.setup-redesign .kpi-toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--setup-border-strong);
  position: relative;
  cursor: pointer;
  transition: 0.2s ease;
}
body.setup-redesign .kpi-toggle.on {
  background: var(--setup-blue);
}
body.setup-redesign .kpi-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
body.setup-redesign .kpi-toggle.on::after {
  transform: translateX(16px);
}
body.setup-redesign .kpi-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
body.setup-redesign .kpi-field label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--setup-text-3);
  display: block;
  margin-bottom: 4px;
}
body.setup-redesign .kpi-field input,
body.setup-redesign .kpi-field select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--setup-border-strong);
  background: var(--setup-surface2);
  font-size: 12px;
  color: var(--setup-text);
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border 0.12s ease;
}
body.setup-redesign .kpi-field input:focus,
body.setup-redesign .kpi-field select:focus {
  border-color: var(--setup-blue);
}
body.setup-redesign .kpi-card:not(.enabled) .kpi-fields {
  opacity: 0.35;
  pointer-events: none;
}

/* ── USER TABS ── */
body.setup-redesign .user-tabs-setup {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--setup-border);
}
body.setup-redesign .user-tab-setup {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--setup-text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
body.setup-redesign .user-tab-setup.active {
  color: var(--setup-blue);
  border-bottom-color: var(--setup-blue);
}
body.setup-redesign .user-tab-setup:hover {
  color: var(--setup-text);
}

/* ── PROFILE CARDS ── */
body.setup-redesign .profile-card-setup {
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
body.setup-redesign .profile-header-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: 0.15s ease;
}
body.setup-redesign .profile-header-setup:hover {
  background: var(--setup-surface2);
}
body.setup-redesign .profile-name-setup {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--setup-text);
}
body.setup-redesign .perm-count-setup {
  font-size: 11px;
  color: var(--setup-text-3);
}
body.setup-redesign .profile-body-setup {
  padding: 0 18px 16px;
}
body.setup-redesign .perm-grid-setup {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-top: 12px;
}
body.setup-redesign .perm-group-setup {
  padding: 10px 12px;
  background: var(--setup-surface2);
  border-radius: var(--setup-radius-sm);
  border: 1px solid var(--setup-border);
}
body.setup-redesign .perm-group-name-setup {
  font-size: 11px;
  font-weight: 600;
  color: var(--setup-text-2);
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
}
body.setup-redesign .perm-chips-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
body.setup-redesign .perm-chip-setup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--setup-bg);
  color: var(--setup-text-2);
  border: 1px solid var(--setup-border);
}
body.setup-redesign .perm-chip-setup.active {
  background: var(--setup-blue-muted);
  color: var(--setup-blue);
  border-color: rgba(37, 99, 235, 0.2);
}

/* ── Permission Matrix (Profile Types) ── */
body.setup-redesign .perm-mx-setup {
  margin-top: 10px;
}

body.setup-redesign .mx-head-setup {
  display: grid;
  grid-template-columns: 1fr repeat(4, 72px) 92px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--setup-surface2);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius-sm);
  margin-bottom: 8px;
}

body.setup-redesign .mx-col-label-setup {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--setup-text-3);
  text-align: center;
}

body.setup-redesign .mx-rows-setup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.setup-redesign .mx-row-setup {
  display: grid;
  grid-template-columns: 1fr repeat(4, 72px) 92px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.setup-redesign .mx-row-setup:hover {
  border-color: var(--setup-border-strong);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

body.setup-redesign .mx-res-setup {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--setup-text);
  min-width: 0;
}

body.setup-redesign .mx-cell-setup {
  height: 28px;
  width: 72px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--setup-border);
  background: var(--setup-surface2);
  color: var(--setup-text-3);
}

body.setup-redesign .mx-y-setup {
  background: var(--setup-blue-muted);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--setup-blue);
}

body.setup-redesign .mx-n-setup {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}

body.setup-redesign .mx-actions-setup {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

body.setup-redesign .mx-actions-setup .action-btn-setup {
  width: 30px;
  height: 30px;
}

@media (max-width: 520px) {
  body.setup-redesign .mx-head-setup,
  body.setup-redesign .mx-row-setup {
    grid-template-columns: 1fr repeat(4, 52px) 76px;
  }

  body.setup-redesign .mx-cell-setup {
    width: 52px;
  }
}

/* ── ANIMATIONS ── */
@keyframes fadeUpSetup {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
body.setup-redesign .tab-content.animate-setup {
  animation: fadeUpSetup 0.25s ease forwards;
}
body.setup-redesign .animate-setup {
  animation: fadeUpSetup 0.25s ease forwards;
}
body.setup-redesign .animate-setup:nth-child(1) { animation-delay: 0.03s; }
body.setup-redesign .animate-setup:nth-child(2) { animation-delay: 0.06s; }
body.setup-redesign .animate-setup:nth-child(3) { animation-delay: 0.09s; }
body.setup-redesign .animate-setup:nth-child(4) { animation-delay: 0.12s; }
body.setup-redesign .animate-setup:nth-child(5) { animation-delay: 0.15s; }
body.setup-redesign .animate-setup:nth-child(6) { animation-delay: 0.18s; }

/* Empty state */
body.setup-redesign .empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--setup-text-3);
  font-size: 13px;
}
body.setup-redesign .empty-state .icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

/* Legacy list/card consistency (portfolios, risks, WBS, etc.) */
body.setup-redesign .collapsible-group {
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
body.setup-redesign .collapsible-header {
  padding: 14px 18px;
  cursor: pointer;
  transition: 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
body.setup-redesign .collapsible-header:hover {
  background: var(--setup-surface2);
}
body.setup-redesign .collapsible-body {
  padding: 0 0 12px 0;
  border-top: 1px solid var(--setup-border);
}
body.setup-redesign .collapsible-body.show {
  display: block;
}
body.setup-redesign .config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--setup-border);
  transition: 0.12s ease;
}

/* ==========================================================================
   Sprint: Setup visual redesign components
   ========================================================================== */

/* Shared action buttons + pill tags (used by redesigned templates) */
body.setup-redesign .ab {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #ebebea;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 11px;
  color: #999;
  transition: 0.12s;
  flex-shrink: 0;
}
body.setup-redesign .ab:hover {
  background: #f5f5f3;
  border-color: #ccc;
  color: #333;
}
body.setup-redesign .ab.del:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}
body.setup-redesign .row-act {
  display: flex;
  gap: 4px;
  align-items: center;
}
body.setup-redesign .chevron {
  color: #ccc;
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

body.setup-redesign .tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}
body.setup-redesign .t-on {
  background: #f0fdf4;
  color: #15803d;
}
body.setup-redesign .t-off {
  background: #f3f4f6;
  color: #9ca3af;
}
body.setup-redesign .t-blue {
  background: #eff6ff;
  color: #1d4ed8;
}
body.setup-redesign .t-amber {
  background: #fefce8;
  color: #a16207;
}
body.setup-redesign .t-purple {
  background: #f5f3ff;
  color: #4338ca;
}

/* ── Qualitative dimensions wrapper fix ── */
body.setup-redesign .dim-grid {
  display: block;
}
/* When the wrapper is a grid, each BU group should span full width */
body.setup-redesign .dim-grid > .collapsible-group {
  grid-column: 1 / -1;
}

/* ── PORTFOLIOS ── */
body.setup-redesign .pf-card {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 7px;
  transition: border-color 0.12s;
}
body.setup-redesign .pf-card:hover {
  border-color: #ccc;
}
body.setup-redesign .pf-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
body.setup-redesign .pf-color {
  width: 10px;
  height: 36px;
  border-radius: 3px;
  flex-shrink: 0;
}
body.setup-redesign .pf-info {
  flex: 1;
  min-width: 0;
}
body.setup-redesign .pf-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.setup-redesign .pf-meta {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
body.setup-redesign .pf-programs {
  border-top: 1px solid #f0f0ee;
}

/* Portfolio program rows (redesign markup) */
body.setup-redesign .children {
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.setup-redesign .child-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(235, 235, 234, 0.9);
}
body.setup-redesign .child-row:last-child {
  border-bottom: none;
}
body.setup-redesign .child-bar {
  width: 3px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
}
body.setup-redesign .child-name {
  font-weight: 700;
  color: #111;
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
}
body.setup-redesign .child-meta {
  font-size: 11.5px;
  color: var(--setup-text-3);
  font-weight: 700;
  flex-shrink: 0;
}
body.setup-redesign .child-act {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── DIMENSIONS ── */
body.setup-redesign .dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 700px) {
  body.setup-redesign .dim-grid {
    grid-template-columns: 1fr;
  }
}
body.setup-redesign .dim-card {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  padding: 14px 16px;
  transition: 0.12s;
}
body.setup-redesign .dim-card:hover {
  border-color: #ccc;
}
body.setup-redesign .dim-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
body.setup-redesign .dim-name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}
body.setup-redesign .dim-desc {
  font-size: 11.5px;
  color: #999;
  margin-top: 2px;
}
body.setup-redesign .dim-act {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
body.setup-redesign .dim-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
body.setup-redesign .dv {
  font-size: 11px;
  color: #555;
  background: #f5f5f3;
  border: 1px solid #ebebea;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── METHODOLOGIES ── */
body.setup-redesign .meth-card {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 7px;
  transition: border-color 0.12s;
}
body.setup-redesign .meth-card:hover {
  border-color: #ccc;
}
body.setup-redesign .meth-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
body.setup-redesign .meth-info {
  flex: 1;
  min-width: 0;
}
body.setup-redesign .meth-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #111;
}
body.setup-redesign .meth-sub {
  font-size: 12px;
  color: #999;
  margin-top: 1px;
}
body.setup-redesign .meth-code {
  font-family: monospace;
  font-size: 11px;
  flex-shrink: 0;
}
body.setup-redesign .phase-count {
  font-size: 11px;
  color: #bbb;
  white-space: nowrap;
  flex-shrink: 0;
}
body.setup-redesign .meth-phases {
  border-top: 1px solid #f0f0ee;
}

/* Disc table (used by redesigned methodologies) */
body.setup-redesign .disc-tbl {
  padding: 8px 0 0;
}
body.setup-redesign .disc-head {
  display: grid;
  align-items: center;
  padding: 0 16px 8px;
  gap: 10px;
  color: #bbb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
body.setup-redesign .disc-th {
  white-space: nowrap;
}
body.setup-redesign .disc-row {
  display: grid;
  grid-template-columns: 50px 1fr 2fr auto;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
}
body.setup-redesign .disc-row:first-of-type {
  border-top: none;
}

/* ── WBS ── */
body.setup-redesign .wbs-card {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: 0.12s;
}
body.setup-redesign .wbs-card:hover {
  border-color: #ccc;
}
body.setup-redesign .wbs-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
body.setup-redesign .wbs-icon {
  font-size: 16px;
  flex-shrink: 0;
}
body.setup-redesign .wbs-info {
  flex: 1;
  min-width: 0;
}
body.setup-redesign .wbs-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #111;
}
body.setup-redesign .wbs-sub {
  font-size: 11.5px;
  color: #999;
  margin-top: 1px;
}
body.setup-redesign .wbs-items {
  border-top: 1px solid #f0f0ee;
}
body.setup-redesign .wbs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 24px;
  border-bottom: 1px solid #f5f5f3;
  font-size: 12.5px;
  position: relative;
}
body.setup-redesign .wbs-item:last-child {
  border-bottom: none;
}
body.setup-redesign .wbs-item.l2 {
  padding-left: 44px;
}
body.setup-redesign .wbs-item.l3 {
  padding-left: 64px;
  font-size: 12px;
  color: #555;
}
body.setup-redesign .wbs-num {
  font-family: monospace;
  font-size: 11px;
  color: #bbb;
  min-width: 44px;
}
body.setup-redesign .wbs-name-cell {
  flex: 1;
  font-weight: 500;
  color: #333;
}
body.setup-redesign .wbs-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f3f4f6;
  color: #666;
}

/* ── MILESTONES ── */
body.setup-redesign .ms-group {
  margin-bottom: 20px;
}
body.setup-redesign .ms-group-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #bbb;
  margin-bottom: 8px;
  padding: 0 2px;
}
body.setup-redesign .ms-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.setup-redesign .ms-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 8px;
  transition: 0.12s;
}
body.setup-redesign .ms-row:hover {
  border-color: #ccc;
}
body.setup-redesign .ms-flag {
  font-size: 14px;
  flex-shrink: 0;
}
body.setup-redesign .ms-main {
  flex: 1;
}
body.setup-redesign .ms-name {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  margin-bottom: 2px;
}
body.setup-redesign .ms-meta {
  font-size: 11.5px;
  color: #999;
}
body.setup-redesign .ms-order {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f5f5f3;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #888;
  flex-shrink: 0;
}

/* ── REPORT TEMPLATES (matrix-ish cards) ── */
body.setup-redesign .rpt-matrix-header {
  margin-bottom: 20px;
}
body.setup-redesign .rpt-method-block {
  margin-bottom: 24px;
}
body.setup-redesign .rpt-method-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0ee;
}
body.setup-redesign .rpt-method-name {
  font-size: 14px;
  font-weight: 800;
  color: #111;
  flex: 1;
}
body.setup-redesign .rpt-method-count {
  font-size: 11px;
  color: #bbb;
}
body.setup-redesign .rpt-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
body.setup-redesign .rpt-mini-card {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  overflow: hidden;
  transition: 0.12s;
}
body.setup-redesign .rpt-mini-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
body.setup-redesign .rpt-mini-type-bar {
  height: 4px;
  width: 100%;
}
body.setup-redesign .rpt-mini-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 8px;
}
body.setup-redesign .rpt-mini-icon {
  font-size: 18px;
  flex-shrink: 0;
}
body.setup-redesign .rpt-mini-info {
  flex: 1;
  min-width: 0;
}
body.setup-redesign .rpt-mini-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #111;
  margin-bottom: 2px;
}
body.setup-redesign .rpt-mini-meta {
  font-size: 11px;
  color: #999;
}
body.setup-redesign .rpt-mini-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 10px;
}
body.setup-redesign .rpt-add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed #ddd;
  border-radius: 9px;
  padding: 20px;
  color: #bbb;
  font-size: 12px;
  cursor: pointer;
  transition: 0.12s;
  min-height: 100px;
}
body.setup-redesign .rpt-add-card:hover {
  border-color: #aaa;
  color: #555;
  background: #f9f9f8;
}

/* Type filter pills (visual) */
body.setup-redesign .type-filter {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
body.setup-redesign .tfc {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  color: #666;
  transition: 0.1s;
}
body.setup-redesign .tfc:hover,
body.setup-redesign .tfc.sel {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* ── USERS ── */
body.setup-redesign .filter-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
body.setup-redesign .srch {
  position: relative;
  flex: 1;
  max-width: 250px;
}
body.setup-redesign .srch input {
  width: 100%;
  padding: 7px 12px 7px 28px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 12.5px;
  background: #fff;
  font-family: inherit;
  outline: none;
  transition: 0.12s;
}
body.setup-redesign .srch input:focus {
  border-color: #aaa;
}
body.setup-redesign .srch::before {
  content: '⌕';
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  pointer-events: none;
}
body.setup-redesign .fsel {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  background: #fff;
  color: #555;
  font-family: inherit;
  outline: none;
}
body.setup-redesign .tbl {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  overflow: hidden;
}
body.setup-redesign .tbl-h {
  display: grid;
  padding: 8px 16px;
  background: #fafaf9;
  border-bottom: 1px solid #f0f0ee;
}
body.setup-redesign .tbl-th {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #bbb;
}
body.setup-redesign .tbl-r {
  display: grid;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid #f5f5f3;
  transition: 0.1s;
}
body.setup-redesign .tbl-r:last-child {
  border-bottom: none;
}
body.setup-redesign .tbl-r:hover {
  background: #fafaf9;
}
body.setup-redesign .u-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* ── Business Units (visual 3-level) ── */
body.setup-redesign .bu-children {
  padding: 4px 0 8px;
}
body.setup-redesign .dir-block {
  border-bottom: 1px solid #f5f5f3;
}
body.setup-redesign .dir-block:last-child {
  border-bottom: none;
}
body.setup-redesign .dir-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 24px;
}
body.setup-redesign .dir-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: #222;
}
body.setup-redesign .child-meta {
  font-size: 11.5px;
  color: #bbb;
  font-weight: 800;
  white-space: nowrap;
}
body.setup-redesign .ger-children {
  border-top: 1px solid #f5f5f3;
  padding: 4px 0 4px 48px;
}
body.setup-redesign .ger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 0;
  border-bottom: 1px solid #fafaf8;
}
body.setup-redesign .ger-row:last-child {
  border-bottom: none;
}
body.setup-redesign .ger-bar {
  width: 2px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}
body.setup-redesign .ger-name {
  flex: 1;
  font-size: 12px;
  color: #444;
}

body.setup-redesign .child-bar {
  width: 2px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}
body.setup-redesign .config-item:hover {
  background: var(--setup-surface2);
}
body.setup-redesign .config-item:last-child {
  border-bottom: none;
}
body.setup-redesign .group-actions {
  padding: 10px 18px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Portfolios & Programs (layout similar ao print) ── */
body.setup-redesign .portfolio-card {
  position: relative;
}
body.setup-redesign .portfolio-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--setup-blue-light);
}
body.setup-redesign .collapsible-header.portfolio-header {
  padding-left: 26px;
}
body.setup-redesign .portfolio-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.setup-redesign .portfolio-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.setup-redesign .portfolio-header-sub {
  font-size: 12px;
  color: var(--setup-text-3);
  font-weight: 700;
}
body.setup-redesign .portfolio-program-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--setup-border);
}
body.setup-redesign .portfolio-program-row:last-child {
  border-bottom: none;
}
body.setup-redesign .portfolio-program-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.setup-redesign .portfolio-program-bullet {
  color: var(--setup-blue-light);
  font-size: 22px;
  line-height: 1;
}
body.setup-redesign .portfolio-program-name {
  font-weight: 800;
  color: var(--setup-text);
}
body.setup-redesign .portfolio-program-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.setup-redesign .portfolio-program-project-count {
  font-size: 12px;
  color: var(--setup-text-3);
  font-weight: 700;
}
body.setup-redesign .portfolio-program-actions .icon-btn {
  width: 34px;
  padding: 6px 0;
  text-align: center;
}

/* ── Risk Categories (layout similar ao print) ── */
body.setup-redesign .risk-cat-table {
  background: var(--setup-surface);
  border: 1px solid var(--setup-border);
  border-radius: var(--setup-radius);
  overflow: hidden;
}
body.setup-redesign .risk-cat-header-row {
  display: grid;
  grid-template-columns: 1fr 2fr 90px;
  padding: 12px 18px;
  background: var(--setup-surface2);
  border-bottom: 1px solid var(--setup-border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--setup-text-3);
}
body.setup-redesign .risk-cat-h-actions {
  justify-self: end;
}
body.setup-redesign .risk-cat-row {
  display: grid;
  grid-template-columns: 1fr 2fr 90px;
  align-items: center;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid var(--setup-border);
  gap: 12px;
}
body.setup-redesign .risk-cat-row:last-child {
  border-bottom: none;
}
body.setup-redesign .risk-cat-name-only {
  font-weight: 900;
  color: var(--setup-text);
  font-size: 14px;
  min-width: 0;
}
body.setup-redesign .risk-cat-desc-only {
  color: var(--setup-text-3);
  font-size: 12px;
  line-height: 1.25;
}
body.setup-redesign .risk-cat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
body.setup-redesign .risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
body.setup-redesign .risk-pill-muted {
  background: #f1f5f9;
  color: #64748b;
}
body.setup-redesign .risk-pill-low {
  background: #d1fae5;
  color: #15803d;
}
body.setup-redesign .risk-pill-med {
  background: #fef3c7;
  color: #92400e;
}
body.setup-redesign .risk-pill-high {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 560px) {
  body.setup-redesign .risk-cat-header-row,
  body.setup-redesign .risk-cat-row {
    grid-template-columns: 1fr;
  }
  body.setup-redesign .risk-cat-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 6px;
  }
}

/* ── WBS Templates (similar ao print da WBS) ── */
body.setup-redesign .wbs-section {
  border-bottom: 1px solid var(--setup-border);
}
body.setup-redesign .wbs-section .config-item-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--setup-text);
}
body.setup-redesign .wbs-subitem .config-item-title {
  font-size: 14px;
  font-weight: 850;
}
body.setup-redesign .wbs-item-number {
  width: auto !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  color: var(--setup-text-3) !important;
  margin-right: 10px !important;
}
body.setup-redesign .wbs-item-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--setup-text-3);
}

/* ── Milestone Templates (layout similar ao print 2) ── */
body.setup-redesign .milestone-template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--setup-border);
}
body.setup-redesign .milestone-template-row:last-child {
  border-bottom: none;
}
body.setup-redesign .ms-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
body.setup-redesign .ms-flag {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--setup-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--setup-text-3);
  font-size: 13px;
  flex-shrink: 0;
}
body.setup-redesign .ms-text {
  min-width: 0;
}
body.setup-redesign .ms-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  color: var(--setup-text);
  font-size: 14px;
}
body.setup-redesign .ms-desc {
  margin-top: 2px;
  color: var(--setup-text-3);
  font-size: 12px;
  line-height: 1.2;
}
body.setup-redesign .ms-badge-wrap {
  flex-shrink: 0;
}
body.setup-redesign .ms-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
body.setup-redesign .ms-badge-required {
  background: #d1fae5;
  color: #15803d;
}
body.setup-redesign .ms-badge-optional {
  background: #f1f5f9;
  color: #64748b;
}
body.setup-redesign .ms-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  justify-content: flex-end;
}

/* ── Qualitative Dimensions (slide similar à WBS) ── */
body.setup-redesign .qd-slide-title {
  display: flex;
  gap: 10px;
  align-items: center;
}
body.setup-redesign .qd-slide-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--setup-blue);
  font-size: 13px;
}
body.setup-redesign .qd-dim-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.setup-redesign .qd-dim-name {
  font-weight: 900;
  color: var(--setup-text);
}
body.setup-redesign .qd-dim-number {
  width: auto !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  color: var(--setup-text-3) !important;
  margin-right: 10px !important;
}

/* ── Report Templates (mais claro/elegante) ── */
body.setup-redesign .report-template-header {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--setup-surface2);
  border-radius: 10px;
  border: 1px solid var(--setup-border);
}
body.setup-redesign .report-template-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}
body.setup-redesign .report-template-label {
  font-size: 12px;
  font-weight: 900;
  color: var(--setup-text-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
body.setup-redesign .report-template-name {
  font-weight: 900;
  color: var(--setup-text);
}
body.setup-redesign .report-template-sub {
  font-size: 12px;
  color: var(--setup-text-3);
}
body.setup-redesign .report-template-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.setup-redesign .report-dimensions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
body.setup-redesign .report-dimensions-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.setup-redesign .report-dimensions-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--setup-blue);
  font-size: 13px;
}
body.setup-redesign .report-dimensions-table-wrap {
  overflow-x: auto;
}

@media (max-width: 560px) {
  body.setup-redesign .milestone-template-row {
    flex-direction: column;
    align-items: flex-start;
  }
  body.setup-redesign .ms-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Business Units 3-level: BU -> Diretoria -> Gerencia
   (markup: bu-card / dir-block / ger-row)
   ========================================================================== */
body.setup-redesign #departmentsList {
  /* Using reference “card + children” layout for org structure */
}

/* Org Structure (Unidades de Negócio) — card/children styling (reference layout) */
body.setup-redesign #departmentsList .list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body.setup-redesign #departmentsList .card {
  background: #fff;
  border: 1px solid #ebebea;
  border-radius: 9px;
  transition: border-color 0.12s;
  overflow: hidden;
}

body.setup-redesign #departmentsList .card:hover {
  border-color: #ccc;
}

body.setup-redesign #departmentsList .card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: default;
  user-select: none;
}

body.setup-redesign #departmentsList .card-main {
  flex: 1;
  min-width: 0;
}

body.setup-redesign #departmentsList .card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.setup-redesign #departmentsList .card-sub {
  font-size: 12px;
  color: #999;
  margin-top: 1px;
}

body.setup-redesign #departmentsList .card-icon {
  font-size: 15px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.7;
}

body.setup-redesign #departmentsList .row-act {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
  align-items: center;
}

body.setup-redesign #departmentsList .card-row:hover .row-act {
  opacity: 1;
}

body.setup-redesign #departmentsList .chevron {
  color: #ccc;
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

body.setup-redesign #departmentsList .chevron.open {
  transform: rotate(90deg);
}

body.setup-redesign #departmentsList .children {
  border-top: 1px solid #f3f3f2;
  padding: 6px 14px 10px 40px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.setup-redesign #departmentsList .child-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: 0.12s;
}

body.setup-redesign #departmentsList .child-row:hover {
  background: #f9f9f8;
  border-color: #ebebea;
}

body.setup-redesign #departmentsList .child-row.l3 {
  padding-left: 28px;
}

body.setup-redesign #departmentsList .child-bar {
  width: 2px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
}

body.setup-redesign #departmentsList .child-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: #333;
}

body.setup-redesign #departmentsList .child-meta {
  font-size: 11px;
  color: #ccc;
  font-family: inherit;
  font-weight: 700;
  flex-shrink: 0;
}

body.setup-redesign #departmentsList .child-act {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: 0.12s;
  flex-shrink: 0;
}

body.setup-redesign #departmentsList .child-row:hover .child-act {
  opacity: 1;
}

body.setup-redesign #departmentsList .add-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px dashed #ddd;
  background: transparent;
  color: #bbb;
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.12s;
  font-family: inherit;
  margin-top: 2px;
}

body.setup-redesign #departmentsList .add-row:hover {
  border-color: #aaa;
  color: #555;
  background: #f9f9f8;
}

body.setup-redesign #departmentsList .add-row.l3 {
  margin-left: 28px;
}

body.setup-redesign #departmentsList .card-row [data-edit-bu],
body.setup-redesign #departmentsList .card-row [data-del-bu],
body.setup-redesign #departmentsList .child-row [data-edit-dir],
body.setup-redesign #departmentsList .child-row [data-del-dir],
body.setup-redesign #departmentsList .child-row [data-edit-ger],
body.setup-redesign #departmentsList .child-row [data-del-ger] {
  /* keep pointer to avoid toggle click confusion */
}

  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.setup-redesign .bu-card {
  background: #fff;
  border: 1px solid #e8e8e6;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.setup-redesign .bu-card:hover {
  border-color: #d0d0ce;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.setup-redesign .bu-header {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  cursor: pointer;
  user-select: none;
  min-height: 60px;
}

body.setup-redesign .bu-accent {
  width: 5px;
  align-self: stretch;
  flex-shrink: 0;
  border-radius: 0;
}

body.setup-redesign .bu-header-body {
  flex: 1;
  padding: 14px 14px 14px 16px;
  min-width: 0;
}

body.setup-redesign .bu-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.setup-redesign .bu-name {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.2px;
}

body.setup-redesign .bu-meta {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}

body.setup-redesign .bu-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.2px;
}
body.setup-redesign .bu-badge-on {
  background: #f0fdf4;
  color: #15803d;
}
body.setup-redesign .bu-badge-off {
  background: #f3f4f6;
  color: #9ca3af;
}

body.setup-redesign .bu-header-actions {
  display: flex;
  gap: 4px;
  padding-right: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}
body.setup-redesign .bu-card:hover .bu-header-actions {
  opacity: 1;
}

body.setup-redesign .bu-chevron {
  font-size: 9px;
  color: #ccc;
  padding-right: 16px;
  padding-left: 4px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
body.setup-redesign .bu-chevron-open {
  transform: rotate(90deg);
}

body.setup-redesign .bu-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #ebebea;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 11px;
  color: #999;
  transition: all 0.12s;
  flex-shrink: 0;
  line-height: 1;
}
body.setup-redesign .bu-icon-btn:hover {
  background: #f5f5f3;
  border-color: #ccc;
  color: #333;
}
body.setup-redesign .bu-icon-btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}
body.setup-redesign .bu-icon-btn-sm {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: 4px;
}

body.setup-redesign .bu-body {
  border-top: 1px solid #f0f0ee;
  padding-bottom: 8px;
}

body.setup-redesign .bu-footer-actions {
  padding: 8px 16px 10px 20px;
  display: flex;
  gap: 8px;
}

body.setup-redesign .bu-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px dashed #d9d9d7;
  background: transparent;
  color: #aaa;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
body.setup-redesign .bu-add-btn:hover {
  border-color: #999;
  color: #444;
  background: #f9f9f8;
}
body.setup-redesign .bu-add-btn-sm {
  font-size: 11px;
  padding: 4px 9px;
}

body.setup-redesign .dir-list {
  padding: 6px 0 2px 0;
}

body.setup-redesign .dir-block {
  border-top: 1px solid #f5f5f3;
}
body.setup-redesign .dir-block:first-child {
  border-top: none;
}

body.setup-redesign .dir-header {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  min-height: 44px;
  user-select: none;
  padding: 8px 0;
}
body.setup-redesign .dir-header:hover {
  background: #fafaf9;
}

body.setup-redesign .dir-track {
  width: 3px;
  align-self: stretch;
  flex-shrink: 0;
  margin-left: 20px;
}

body.setup-redesign .dir-header-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 14px;
  min-width: 0;
  flex-wrap: wrap;
}

body.setup-redesign .dir-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
}

body.setup-redesign .dir-count {
  font-size: 11px;
  color: #bbb;
  margin-left: auto;
  white-space: nowrap;
}

body.setup-redesign .dir-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}
body.setup-redesign .dir-badge-on {
  background: #f0fdf4;
  color: #15803d;
}
body.setup-redesign .dir-badge-off {
  background: #f3f4f6;
  color: #9ca3af;
}

body.setup-redesign .dir-header-actions {
  display: flex;
  gap: 3px;
  padding-right: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}
body.setup-redesign .dir-block:hover .dir-header-actions {
  opacity: 1;
}

body.setup-redesign .dir-chevron {
  font-size: 8px;
  color: #ccc;
  padding-right: 16px;
  padding-left: 4px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

body.setup-redesign .ger-list {
  background: #fafaf9;
  border-top: 1px solid #f0f0ee;
  margin-left: 0;
  padding: 0 0 6px 0;
}

body.setup-redesign .ger-items {
  padding: 0 0 2px 0;
}

body.setup-redesign .ger-add-row {
  padding: 6px 20px 8px 60px;
}

body.setup-redesign .dir-empty,
body.setup-redesign .ger-empty,
body.setup-redesign .bu-empty {
  padding: 14px 20px;
  font-size: 12px;
  color: #bbb;
  font-style: italic;
}

body.setup-redesign .ger-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 12px 8px 0;
}

body.setup-redesign .ger-indent {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 60px;
  position: relative;
  align-self: stretch;
}
body.setup-redesign .ger-line {
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e5e5e3;
}
body.setup-redesign .ger-dot {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

body.setup-redesign .ger-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  color: #333;
  padding: 0 10px;
}

body.setup-redesign .ger-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
body.setup-redesign .ger-badge-on {
  background: #f0fdf4;
  color: #15803d;
}
body.setup-redesign .ger-badge-off {
  background: #f3f4f6;
  color: #9ca3af;
}

body.setup-redesign .ger-actions {
  display: flex;
  gap: 3px;
  padding-right: 12px;
  padding-left: 8px;
}

