/* ==========================================================================
   Execution Tab — execution.css
   ========================================================================== */

/* Execution tab: no page-level scroll — tbody scrolls internally */
#tab-execution {
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}
#execution-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Loading overlay ──────────────────────────────────────── */

/* ==========================================================================
   Execution Efficiency page — execution.css
   ========================================================================= */

/* ── Page layout ── */
.exec-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Toolbar (sync button + last-synced) inside the tab ── */
.exec-tab-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Summary bar ── */
.exec-summary-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 16px 20px;
}
.exec-summary-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.exec-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}
.exec-summary-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
}
.exec-summary-val {
  font-size: 22px;
  font-weight: 700;
}
.exec-summary-val.est    { color: #3B82F6; }
.exec-summary-val.sp     { color: #8B5CF6; }
.exec-summary-val.bug    { color: #EF4444; }
.exec-summary-val.actual { color: #10B981; }
.exec-summary-val.eff    { color: #F59E0B; }
.exec-bug-ratio  { font-size: 13px; font-weight: 500; margin-left: 4px; opacity: 0.75; }

/* ── Main table ── */
.exec-table-wrap {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.exec-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
/* Header table — fixed, never scrolls */
.exec-thead-wrap {
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 2px solid #E2E8F0;
}
.exec-thead-wrap .exec-table thead th {
  background: #F8FAFC;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748B;
  white-space: nowrap;
  padding: 10px 12px;
  text-align: left;
}
/* Body wrapper — only this scrolls */
.exec-tbody-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.exec-table th,
.exec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 13px;
}
.exec-table tbody tr:hover { background: #F8FAFC; }
.exec-table tbody tr:last-child td { border-bottom: none; }

.exec-col-epic   { width: 22%; min-width: 200px; }
.exec-col-status { width: 7%;  min-width: 80px; }
.exec-col-est    { width: 11%; min-width: 100px; }
.exec-col-plan   { width: 7%;  min-width: 70px;  text-align: left; }
.exec-col-sp     { width: 8%;  min-width: 75px;  text-align: left; }
.exec-col-bug    { width: 8%;  min-width: 75px;  text-align: left; }
.exec-col-actual { width: 8%;  min-width: 75px;  text-align: left; }
.exec-col-eff    { width: 8%;  min-width: 75px;  text-align: left; }
.exec-col-deveff { width: 8%;  min-width: 75px;  text-align: left; }
.exec-col-eff    { width: 8%;  min-width: 75px;  text-align: left; }
.exec-col-toggle { width: 4%;  min-width: 36px;  text-align: center; }
.exec-bug-val    { color: #DC2626; }

.exec-epic-summary {
  display: block;
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

/* ── Team badges in Estimated column ── */
.exec-team-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #1E293B;
  background: #F1F5F9;
  border: 1.5px solid #94A3B8;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
  white-space: nowrap;
}

/* ── Assign count ── */
.exec-assign-count {
  font-size: 12px;
  color: #475569;
}

/* ── Efficiency badge ── */
.exec-eff-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #64748B;
}
.exec-eff-badge.eff-good { background: #D1FAE5; color: #065F46; }  /* < 80% */
.exec-eff-badge.eff-warn { background: #FEF3C7; color: #92400E; }  /* 80–100% */
.exec-eff-badge.eff-over { background: #FEE2E2; color: #991B1B; }  /* > 100% */

/* ── Toggle button ── */
.exec-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: #94A3B8;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s, transform 0.2s;
}
.exec-toggle-btn:hover { color: #3B82F6; background: #EFF6FF; }
.exec-toggle-btn.open { transform: rotate(180deg); color: #3B82F6; }

/* ── Open row highlight ── */
.exec-epic-row.open td { background: #F8FAFC; }

/* ── Detail cell ── */
.exec-detail-cell {
  padding: 0 !important;
  background: #F8FAFC;
  border-bottom: 2px solid #E2E8F0 !important;
}
.exec-detail-section {
  padding: 14px 16px;
  border-bottom: 1px solid #E2E8F0;
}
.exec-detail-section:last-child { border-bottom: none; }
.exec-detail-section--bug { background: #FFF8F8; }

/* ── Collapsible section toggle button ── */
.exec-section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  padding: 0;
  margin-bottom: 10px;
  width: 100%;
}
.exec-section-toggle:hover { color: #1E293B; }
.exec-section-toggle--bug  { color: #DC2626; }
.exec-section-toggle--bug:hover { color: #991B1B; }
.exec-section-arrow {
  font-size: 9px;
  display: inline-block;
  transition: transform 0.2s;
  transform: rotate(-90deg); /* collapsed = pointing right */
}
.exec-section-toggle.open .exec-section-arrow {
  transform: rotate(0deg);   /* expanded = pointing down */
}
.exec-section-count {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #94A3B8;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 0 6px;
}
.exec-detail-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.exec-detail-heading--bug { color: #DC2626; }
.exec-bug-summary-inline {
  font-size: 11px;
  font-weight: 500;
  color: #DC2626;
  background: #FEE2E2;
  border-radius: 4px;
  padding: 1px 7px;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Detail inner tables ── */
.exec-detail-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  overflow: hidden;
}
.exec-detail-table th,
.exec-detail-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.exec-detail-table thead th {
  background: #F8FAFC;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748B;
  text-align: left;
}
.exec-detail-table tbody tr:last-child td { border-bottom: none; }
.exec-detail-table tbody tr:hover { background: #F8FAFC; }

/* ── Assignment detail cols ── */
.exec-d-name    { width: 220px; }
.exec-d-team    { width: 200px; }
.exec-d-alloc   { width: 100px; text-align: right; }
.exec-d-implied { width: 120px; text-align: right; color: #3B82F6; font-weight: 600; }

.exec-person-name { font-weight: 600; color: #1E293B; }
.exec-person-sub  { font-size: 11px; color: #94A3B8; margin-left: 6px; }
.exec-team-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* ── Ticket detail table ── */
.exec-tickets-table .exec-child-row td { font-weight: 500; background: #F8FAFC; }
.exec-tickets-table .exec-subtask-row td { font-size: 11.5px; }

.exec-child-key { min-width: 90px; }
.exec-child-summary { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.exec-sub-indent {
  padding-left: 28px !important;
  color: #64748B;
}
.exec-sub-key { font-size: 11px; color: #64748B; }

/* ── Type badge ── */
.exec-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: #F1F5F9;
  color: #64748B;
  white-space: nowrap;
}
/* Story → green */
.exec-type-badge.type-story    { background: #DCFCE7; color: #15803D; }
/* Task → blue */
.exec-type-badge.type-task     { background: #DBEAFE; color: #1D4ED8; }
/* Bug → red */
.exec-type-badge.type-bug      { background: #FEE2E2; color: #DC2626; }
/* DEV-Task / QA-Task → grey (default, already covered by base) */
.exec-type-badge.type-sub      { background: #F1F5F9; color: #64748B; }

/* ── Status badge (Jira category colours) ── */
.exec-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 3px;
  background: #F1F5F9;
  color: #475569;
  white-space: nowrap;
}
/* To Do → grey */
.exec-status-badge.status-todo        { background: #F1F5F9; color: #475569; }
/* In Progress → Jira blue */
.exec-status-badge.status-inprogress  { background: #DBEAFE; color: #1D4ED8; }
/* Done → Jira green */
.exec-status-badge.status-done        { background: #DCFCE7; color: #15803D; }

.exec-detail-empty {
  padding: 20px;
  color: #94A3B8;
  font-size: 13px;
  text-align: center;
}

.text-right { text-align: right; }
