/* =========================================
   Field Executive Dashboard – Layout & UI
   ========================================= */

#sbcFieldExecDashboard {
  background: #f5f7fb;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  font-size: 14px;
}

#sbcFieldExecDashboard h2.h4 {
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 46px;
  text-transform: uppercase;
  color: #1b63ae;
  background-image: linear-gradient(45deg, #1b63ae, #0f4205 50%, #60a15e 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

#sbcFieldExecDashboard h2.h4::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

/* Primary CTA button ("Create Task") */
#sbcFieldExecDashboard .btn.btn-primary.btn-sm {
  border-radius: 999px;
  padding-inline: 1.25rem;
  font-weight: 500;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}

#sbcFieldExecDashboard .btn.btn-primary.btn-sm:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

#sbcFieldExecDashboard .btn.btn-secondary.btn-sm {
  border-radius: 999px;
  padding-inline: 1rem;
  font-weight: 500;
}

/* Toast / message bar */
#sbcFeToast {
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 13px;
  margin-bottom: 0.75rem;
  border: none;
  display: none;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

#sbcFeToast.sbc-success {
  display: block;
  background: #ecfdf3;
  color: #166534;
}

#sbcFeToast.sbc-error {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
}

/* =========================================
   Tasks Table
   ========================================= */

#sbcFieldExecDashboard .table-responsive {
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

#sbcFeTasksTable {
  margin-bottom: 0;
}

#sbcFeTasksTable thead.table-light {
  background: #f1f5f9;
}

#sbcFeTasksTable thead th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

#sbcFeTasksTable tbody td {
  vertical-align: middle;
  border-color: #f3f4f6;
  color: #111827;
}

#sbcFeTasksTable tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

#sbcFeTasksTable tbody tr:hover {
  background-color: #eff6ff;
}

#sbcFeTasksTable td:nth-child(2),
#sbcFeTasksTable td:nth-child(3),
#sbcFeTasksTable td:nth-child(5) {
  font-weight: 500;
}

#sbcFeTasksTable td:nth-child(8) {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

/* Optional status pill style (if you output .status-badge in JS/PHP) */
#sbcFieldExecDashboard .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#sbcFieldExecDashboard .status-pending {
  background: #fef3c7;
  color: #92400e;
}

#sbcFieldExecDashboard .status-in-progress,
#sbcFieldExecDashboard .status-in_progress {
  background: #e0f2fe;
  color: #075985;
}

#sbcFieldExecDashboard .status-completed {
  background: #dcfce7;
  color: #166534;
}

#sbcFieldExecDashboard .status-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

#sbcFieldExecDashboard .status-on-hold,
#sbcFieldExecDashboard .status-hold {
  background: #e5e7eb;
  color: #374151;
}

/* =========================================
   General Modal Look & Animation
   (applies to FE Task, Action, History modals)
   ========================================= */

#sbcFeTaskModal .modal-dialog,
#sbcFeActionModal .modal-dialog,
#sbcFeHistoryModal .modal-dialog {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
}

#sbcFeTaskModal.show .modal-dialog,
#sbcFeActionModal.show .modal-dialog,
#sbcFeHistoryModal.show .modal-dialog {
  transform: translateY(0);
  opacity: 1;
}

#sbcFeTaskModal .modal-content,
#sbcFeActionModal .modal-content,
#sbcFeHistoryModal .modal-content {
  border-radius: 0.9rem;
  border: none;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

#sbcFeTaskModal .modal-header,
#sbcFeActionModal .modal-header,
#sbcFeHistoryModal .modal-header {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.8rem 1.25rem;
  background: #f9fafb;
}

#sbcFeTaskModal .modal-title,
#sbcFeActionModal .modal-title,
#sbcFeHistoryModal .modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

#sbcFeTaskModal .modal-body,
#sbcFeActionModal .modal-body,
#sbcFeHistoryModal .modal-body {
  padding: 1rem 1.25rem 0.9rem;
  scroll-behavior: smooth;
}

/* Action & history modal footers */
#sbcFeActionModal .modal-footer,
#sbcFeHistoryModal .modal-footer {
  border-top: 1px solid #e5e7eb;
  padding: 0.5rem 0.9rem;
  background: #f9fafb;
}

/* =========================================
   FE Create Task Modal – Scrollable Body
   ========================================= */

/* IMPORTANT: in your PHP, use:
   <div class="modal-dialog modal-lg">  (no 'modal-dialog-scrollable')
*/

#sbcFeTaskModal .modal-dialog {
  max-width: 900px;
  margin: 1.75rem auto;
}

/* Flex layout: header + body (scrolls) + footer */
#sbcFeTaskModal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem); /* space top/bottom */
}

/* Scrollable body, footer fixed at bottom */
#sbcFeTaskModal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  scroll-behavior: smooth;
  flex-shrink: 0;
  border-top: 1px solid #e5e7eb;
  padding: 0.5rem 0.9rem;
  background: #f9fafb;
}

/* Footer (Close + Create Task) stays visible */
#sbcFeTaskModal .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid #e5e7eb;
  padding: 0.5rem 0.9rem;
  background: #f9fafb;
}

/* Nice scrollbars in FE modal (WebKit) */
#sbcFeTaskModal .modal-body::-webkit-scrollbar {
  width: 6px;
}

#sbcFeTaskModal .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

#sbcFeTaskModal .modal-body::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 999px;
}

#sbcFeTaskModal .modal-body::-webkit-scrollbar-thumb:hover {
  background: #93c5fd;
}

/* =========================================
   Form Fields in Modals
   ========================================= */

#sbcFeTaskModal .form-label,
#sbcFeActionModal .form-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

#sbcFeTaskModal .form-control,
#sbcFeTaskModal .form-select,
#sbcFeActionModal .form-control,
#sbcFeActionModal .form-select {
  border-radius: 0.55rem;
  border-color: #e5e7eb;
  font-size: 13px;
}

#sbcFeTaskModal .form-control:focus,
#sbcFeTaskModal .form-select:focus,
#sbcFeActionModal .form-control:focus,
#sbcFeActionModal .form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

/* =========================================
   History modal content helpers (optional)
   ========================================= */

#sbcFeHistoryContent {
  font-size: 13px;
  line-height: 1.45;
  color: #111827;
}

#sbcFeHistoryContent .history-item {
  padding: 0.45rem 0.25rem;
  border-bottom: 1px dashed #e5e7eb;
}

#sbcFeHistoryContent .history-time {
  font-size: 11px;
  color: #6b7280;
}

#sbcFeHistoryContent .history-label {
  font-weight: 600;
  color: #111827;
  margin-right: 0.35rem;
}

/* =========================================
   Responsive tweaks
   ========================================= */

@media (max-width: 768px) {
  #sbcFieldExecDashboard {
    padding: 1rem;
    border-radius: 0.5rem;
  }

  #sbcFeTaskModal .modal-dialog {
    margin: 0.75rem;
    max-width: 100%;
  }

  #sbcFeTaskModal .modal-content {
    max-height: calc(100vh - 1.5rem);
  }

  #sbcFeTaskModal .modal-body {
    padding: 0.75rem 0.75rem 0.5rem;
  }
}

/* Action buttons inside task table: force horizontal layout */
#sbcFeTasksTable td:last-child {
  display: flex;
  align-items: center;
  gap: 6px; /* spacing between buttons */
  white-space: nowrap;
}

#sbcFeTasksTable td:last-child .btn {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  #sbcFeTasksTable td:last-child .btn {
    padding: 2px 6px;
    font-size: 11px;
  }
}


