.approval-view {
  display: flex;
  flex-direction: column; /* Changed to column to stack header */
  height: 100%;
  background-color: var(--bg);
  overflow: hidden;
  position: relative; /* Context for absolute positioning */
}

/* Header (Copied/Adapted from Task List) */
.app-header {
  background: var(--card);
  padding: 12px 16px 0 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  z-index: 10;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.app-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.tabs-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.global-tabs {
  display: flex;
  gap: 24px; /* Increased gap for better touch targets */
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  align-items: center;
  flex: 1;
}
.global-tabs::-webkit-scrollbar { display: none; }

.g-tab {
  font-size: 15px;
  color: var(--text-sub);
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
  cursor: pointer;
  padding: 4px 0;
}
.g-tab:hover {
  color: var(--text-main);
}
.g-tab.active {
  color: var(--blue);
  font-weight: 700;
}
.g-tab.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
}

/* Floating Capsule Navigation (Right Side Persistent) */
.floating-nav-container {
  position: fixed;
  right: 16px; /* Increased margin from right */
  left: auto;
  bottom: 80px; /* Increased bottom margin for "expand upwards" effect and clearance */
  top: auto;
  transform: none;
  width: auto;
  height: auto;
  background: #fff;
  border: 1px solid #e0e0e0; /* Border as requested */
  border-radius: 20px; /* Adjusted radius for narrower look */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 6px 0; /* Further reduced padding */
  display: flex;
  flex-direction: column;
}

/* Hide Handle */
.nav-handle {
  display: none;
}

/* Nav Content */
.nav-content {
  display: flex;
  flex-direction: column;
  width: auto;
  opacity: 1;
  pointer-events: auto;
}

.nc-header {
  display: none; /* Hidden for compactness */
}

.nc-menu {
  flex: 1;
  overflow-y: auto;
  padding: 0 4px; /* Reduced padding */
  display: flex;
  flex-direction: column;
  gap: 4px; /* Reduced gap */
}

.nc-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px; /* Further reduced padding for narrower look */
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-sub);
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
  font-size: 13px; /* Slightly smaller font */
  font-weight: 500;
  user-select: none; /* Prevent text selection */
}

.nc-text {
  pointer-events: none; /* Ensure clicks pass through to .nc-item */
}

.nc-item:hover {
  background: #f5f7fa;
  color: var(--text-main);
}

.nc-item.active {
  background: #e6f7ff;
  color: var(--blue);
  font-weight: 600;
}

/* Icons are hidden in HTML, but if enabled: */
.nc-icon {
  margin-right: 8px;
  font-size: 16px;
  display: none; 
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: #ff4757;
  border-radius: 50%;
}

.nc-footer {
  padding: 0 4px 4px 4px; /* Reduced padding */
  margin-bottom: 4px;
  /* border-top: 1px solid #f0f0f0; */
  display: flex;
  justify-content: center;
}

.nc-btn-add {
  width: 32px; /* Reduced size */
  height: 32px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px; /* Reduced font size */
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,123,255,0.3);
  transition: transform 0.2s;
}

.nc-btn-add:hover {
  transform: scale(1.1);
}

/* Adjust main content padding since nav is floating on right */
.approval-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  padding-right: 100px; /* Make room for right nav */
  padding-bottom: 40px;
  background-color: #f5f7fa;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative; /* Ensure z-index works if needed */
}

/* Remove Old Sidebar Styles */
.app-sidebar, .mobile-header, .mobile-backdrop {
  display: none !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .approval-content {
    padding: 16px;
    padding-right: 16px; /* Reset padding */
    padding-bottom: 80px; /* Space for bottom nav if exists, or just safe area */
  }
  
  /* On mobile, maybe move it to bottom or keep it floating small? */
  /* User said "mobile view is full of menus", but this floating capsule is small */
  /* Let's keep it on right but smaller scale or maybe hide text? */
  /* Actually, for mobile, a vertical right bar might overlap content. */
  /* But for now, let's keep user request "right side". */
  /* Maybe scale it down */
  .floating-nav-container {
    transform: scale(0.9);
    transform-origin: bottom right;
    right: 16px;
    bottom: 80px;
  }
  .nc-item {
    padding: 6px 8px;
    font-size: 12px;
  }
}

/* Approval Card (Refactored) */
.approval-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.approval-card:active {
  transform: scale(0.99);
}

.ac-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ac-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ac-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #f0f0f0;
}
.ac-user-info {
  display: flex;
  flex-direction: column;
}
.ac-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}
.ac-time {
  font-size: 12px;
  color: var(--text-light);
}
.ac-actions {
  display: flex;
  gap: 8px;
}

.ac-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}
.ac-desc {
  font-size: 13px;
  color: var(--text-sub);
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #e2e8f0;
}

.ac-progress-section {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  flex-direction: column; /* Changed to stack title and list */
}
.ac-list-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-list-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.ac-subtask-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ac-subtask-item {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ac-check {
  color: #10b981;
  font-weight: bold;
  font-size: 14px;
}

.ac-avatars-list {
  display: flex;
  align-items: flex-start; /* Changed from center to allow top alignment of labels */
  flex-wrap: wrap;
  gap: 4px; /* Reduced gap between items since we have arrows */
}

/* New Flow Step Styles */
.ac-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 4px;
}
.ac-step-label {
  font-size: 10px;
  color: #888;
  margin-bottom: 6px;
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.ac-step-content {
  display: flex;
  align-items: center;
}

.ac-approver-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* Enhanced Approver Visualization */
.ac-approver-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
}
.ac-approver-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.ac-approver-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  font-size: 10px;
  z-index: 2;
}
.ac-approver-badge.done {
  background: #52c41a;
  color: #fff;
}
.ac-approver-badge.rejected {
  background: #f5222d;
  color: #fff;
}
.ac-approver-badge.pending {
  background: #fa8c16;
  color: #fff;
}

.ac-approver-name {
  font-size: 10px;
  color: var(--text-sub);
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Flow Arrow */
.ac-flow-arrow {
  color: #ccc;
  margin: 0 6px;
  font-size: 14px;
  align-self: center;
  margin-top: 24px; /* Push down to align with avatars roughly, considering label height */
}

.ac-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

/* Inline Input Area */
.ac-input-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-comment-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
  font-family: inherit;
}
.ac-comment-input:focus {
  border-color: var(--blue);
  outline: none;
}
.ac-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Tag Styles from previous version */
.tag-task, .tag-review, .tag-resource {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tag-task { background: #e3f2fd; color: var(--blue); }
.tag-review { background: #fff7ed; color: #f97316; }
.tag-resource { background: #ecfdf5; color: #10b981; }

.btn-reject, .btn-approve {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-reject { background: #fee2e2; color: #ef4444; }
.btn-approve { background: var(--blue); color: #fff; }
.btn-reject:hover, .btn-approve:hover { opacity: 0.9; }

/* Resources */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.resource-item {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.res-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}
.res-name {
  font-size: 13px;
  color: var(--text-main);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.res-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

/* Modals */
.modal-transfer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.mt-box {
  background: #fff;
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 90%;
  overflow: hidden;
}

.initiate-modal {
  /* No fixed dimensions, use flex */
}

.mt-title {
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid #f0f0f0;
}
.mt-content-box {
  padding: 16px;
  overflow-y: auto;
}
.mt-actions {
  padding: 16px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Badges */
.bdg {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
  line-height: 1.4;
}
.bdg-success { background: #dcfce7; color: #166534; }
.bdg-warning { background: #fef9c3; color: #854d0e; }
.bdg-danger { background: #fee2e2; color: #991b1b; }
.bdg-info { background: #e0f2fe; color: #075985; }
.bdg-default { background: #f3f4f6; color: #374151; }

.bdg-main {
  background: #e3fcef;
  color: #00875a;
  border: 1px solid #00875a;
}
.bdg-sub {
  background: #deebff;
  color: #0052cc;
  border: 1px solid #0052cc;
}

.bdg-todo { background: #f3f4f6; color: #6b7280; }
.bdg-doing { background: #e0f2fe; color: #0284c7; }
.bdg-done { background: #dcfce7; color: #166534; }
.bdg-block { background: #fee2e2; color: #991b1b; }
.bdg-pending { background: #fff7ed; color: #c2410c; }
.bdg-review { background: #fef9c3; color: #854d0e; }
