/* Portal project page */
.portal-project-header {
  background: linear-gradient(135deg, #f8fbff 0%, #eef6fc 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.portal-project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.portal-project-stat-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.portal-project-stat-value {
  font-weight: 600;
  color: #0f172a;
}

.portal-tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.portal-tasks-toolbar h4 {
  margin: 0;
  font-weight: 600;
}

/* View tabs — same active state as portal sidebar (.sidebar-item a.active) */
.portal-view-tabs,
ul.project-tasks-view-tabs {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  background: none !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9;
}

.portal-view-tabs .portal-view-tab-item,
ul.project-tasks-view-tabs .portal-view-tab-item {
  margin: 0;
}

.portal-view-tab,
ul.project-tasks-view-tabs a.portal-view-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem !important;
  color: #1a1a1a !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.portal-view-tab::after,
ul.project-tasks-view-tabs a.portal-view-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-color: transparent;
  transition: background-color 0.12s ease;
}

.portal-view-tab i,
ul.project-tasks-view-tabs a.portal-view-tab i {
  width: 14px;
  font-size: 13px;
  text-align: center;
  color: currentColor !important;
  flex-shrink: 0;
  opacity: 0.85;
}

.portal-view-tab:hover,
.portal-view-tab:focus,
ul.project-tasks-view-tabs a.portal-view-tab:hover,
ul.project-tasks-view-tabs a.portal-view-tab:focus {
  color: var(--primary, #0284c7) !important;
  background-color: var(--primary-light, #e0f2fe) !important;
  outline: none !important;
  box-shadow: none !important;
}

.portal-view-tab:hover::after,
.portal-view-tab:focus::after,
.portal-view-tab.active::after,
ul.project-tasks-view-tabs a.portal-view-tab:hover::after,
ul.project-tasks-view-tabs a.portal-view-tab:focus::after,
ul.project-tasks-view-tabs a.portal-view-tab.active::after {
  background-color: #0284c7;
}

.portal-view-tab.active,
.portal-view-tab.active:hover,
.portal-view-tab.active:focus,
ul.project-tasks-view-tabs a.portal-view-tab.active,
ul.project-tasks-view-tabs a.portal-view-tab.active:hover,
ul.project-tasks-view-tabs a.portal-view-tab.active:focus {
  color: var(--primary, #0284c7) !important;
  background-color: var(--primary-light, #e0f2fe) !important;
  box-shadow: none !important;
}

/* List view */
.portal-list-header {
  background: #f8fafc;
  border-radius: 8px 8px 0 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.portal-task-item {
  border-bottom: 1px solid #f1f5f9;
  padding: 0.85rem 1rem;
  transition: background 0.12s ease;
}

.portal-task-item:hover {
  background: #f8fafc;
}

.portal-task-row {
  margin: 0;
}

.portal-task-link {
  color: #0f172a;
  font-weight: 500;
  text-decoration: none;
}

.portal-task-link:hover {
  color: #0284c7;
  text-decoration: none;
}

.portal-status-pill,
.portal-priority-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.portal-status-orange { background: #ffedd5; color: #c2410c; }
.portal-status-blue { background: #dbeafe; color: #1d4ed8; }
.portal-status-yellow { background: #fef9c3; color: #a16207; }
.portal-status-red { background: #fee2e2; color: #b91c1c; }
.portal-status-green { background: #dcfce7; color: #15803d; }
.portal-status-grey { background: #f1f5f9; color: #475569; }
.portal-status-purple { background: #ede9fe; color: #6d28d9; }

.portal-priority-grey { background: #f1f5f9; color: #475569; }
.portal-priority-blue { background: #dbeafe; color: #1d4ed8; }
.portal-priority-orange { background: #ffedd5; color: #c2410c; }
.portal-priority-red { background: #fee2e2; color: #b91c1c; }

.portal-avatar {
  width: 28px;
  height: 28px;
  margin-right: -6px;
  border: 2px solid #fff;
}

.portal-task-assignees {
  display: flex;
  align-items: center;
}

/* Gantt */
#tasks-gantt-view {
  min-height: 420px;
  overflow-x: auto;
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
}

.portal-gantt-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.portal-gantt-mode-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 12px;
  cursor: pointer;
}

.portal-gantt-mode-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}

.gantt .details-container {
  padding: 0 !important;
}

/* Override frappe-gantt dark popup shell */
#tasks-gantt-view .gantt-container .popup-wrapper,
.gantt-container .popup-wrapper {
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
  padding: 0 !important;
  min-width: 280px;
  overflow: hidden;
}

#tasks-gantt-view .gantt-container .popup-wrapper .pointer,
.gantt-container .popup-wrapper .pointer {
  display: none !important;
}

.portal-gantt-popup {
  min-width: 280px;
  padding: 1rem 1.15rem 0.85rem;
  background: #fff;
}

.portal-gantt-popup-header {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.portal-gantt-popup-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.portal-gantt-popup-dates {
  font-size: 12px;
  color: #64748b;
}

.portal-gantt-popup-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.portal-gantt-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 12px;
}

.portal-gantt-popup-label {
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.portal-gantt-popup-value {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
}

.portal-gantt-popup-value .portal-status-pill,
.portal-gantt-popup-value .portal-priority-pill {
  font-size: 11px;
}

.portal-gantt-popup-assignees {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.portal-gantt-popup-assignees .portal-avatar {
  width: 26px;
  height: 26px;
  margin-right: 0;
}

.portal-gantt-popup-assignees .standard-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 10px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0284c7;
  border-radius: 50%;
}

.portal-gantt-popup-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.portal-gantt-popup-actions a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0284c7;
  text-decoration: none;
}

.portal-gantt-popup-actions a:hover {
  color: #0369a1;
  text-decoration: none;
}

/* Kanban */
.project-kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.project-kanban-column {
  min-width: 260px;
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem;
}

.project-kanban-column-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #334155;
}

.project-kanban-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.project-kanban-card:hover {
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1);
}

.project-kanban-card-title {
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.project-kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 12px;
}

@media (max-width: 767px) {
  .portal-view-tabs {
    width: 100%;
    overflow-x: auto;
  }
}
